diff --git a/line_profiler/line_profiler.py b/line_profiler/line_profiler.py index e2156d80..5c3e6f9d 100755 --- a/line_profiler/line_profiler.py +++ b/line_profiler/line_profiler.py @@ -153,12 +153,14 @@ def add_module(self, mod): # This could be in the ipython_extension submodule, # but it doesn't depend on the IPython module so it's easier to just let it stay here. -def is_ipython_kernel_cell(filename): - """ Return True if a filename corresponds to a Jupyter Notebook cell +def is_generated_code(filename): + """ Return True if a filename corresponds to generated code, such as a + Jupyter Notebook cell. """ filename = os.path.normcase(filename) temp_dir = os.path.normcase(tempfile.gettempdir()) return ( + filename.startswith('