Skip to content

Commit

Permalink
Normalize path before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
amirebrahimi authored and Erotemic committed Apr 28, 2024
1 parent d9d9ad1 commit a9103cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions line_profiler/line_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def add_module(self, mod):
def is_ipython_kernel_cell(filename):
""" Return True if a filename corresponds to a Jupyter Notebook cell
"""
filename = os.path.normpath(filename)
return (
filename.startswith('<ipython-input-') or
filename.startswith(os.path.join(tempfile.gettempdir(), 'ipykernel_')) or
Expand Down

0 comments on commit a9103cf

Please sign in to comment.