Show More
@@ -183,13 +183,13 b' python-profiler package from non-free.""")' | |||||
183 | arg_str += '\n' + cell |
|
183 | arg_str += '\n' + cell | |
184 | return self._run_with_profiler(arg_str, opts, self.shell.user_ns) |
|
184 | return self._run_with_profiler(arg_str, opts, self.shell.user_ns) | |
185 |
|
185 | |||
186 |
def _run_with_profiler(self, |
|
186 | def _run_with_profiler(self, code, opts, namespace): | |
187 |
|
187 | |||
188 | opts.merge(Struct(D=[''], l=[], s=['time'], T=[''])) |
|
188 | opts.merge(Struct(D=[''], l=[], s=['time'], T=[''])) | |
189 |
|
189 | |||
190 | prof = profile.Profile() |
|
190 | prof = profile.Profile() | |
191 | try: |
|
191 | try: | |
192 |
prof = prof.runctx( |
|
192 | prof = prof.runctx(code, namespace, namespace) | |
193 | sys_exit = '' |
|
193 | sys_exit = '' | |
194 | except SystemExit: |
|
194 | except SystemExit: | |
195 | sys_exit = """*** SystemExit exception caught in code being profiled.""" |
|
195 | sys_exit = """*** SystemExit exception caught in code being profiled.""" |
General Comments 0
You need to be logged in to leave comments.
Login now