Run lines of code in IPythonApp.exec_lines in the user's namespace.
(self)
| 364 | self.shell._sys_modules_keys = set(sys.modules.keys()) |
| 365 | |
| 366 | def _run_exec_lines(self): |
| 367 | """Run lines of code in IPythonApp.exec_lines in the user's namespace.""" |
| 368 | if not self.exec_lines: |
| 369 | return |
| 370 | try: |
| 371 | self.log.debug("Running code from IPythonApp.exec_lines...") |
| 372 | for line in self.exec_lines: |
| 373 | try: |
| 374 | self.log.info("Running code in user namespace: %s" % |
| 375 | line) |
| 376 | self.shell.run_cell(line, store_history=False) |
| 377 | except: |
| 378 | self.log.warning("Error in executing line in user " |
| 379 | "namespace: %s" % line) |
| 380 | self.shell.showtraceback() |
| 381 | except: |
| 382 | self.log.warning("Unknown error in handling IPythonApp.exec_lines:") |
| 383 | self.shell.showtraceback() |
| 384 | |
| 385 | def _exec_file(self, fname, shell_futures=False): |
| 386 | try: |
no test coverage detected