Skip to content

Commit c715356

Browse files
authored
Merge pull request #264 from Erotemic/rebased-normpath-comparison
Rebased normpath comparison
2 parents d9d9ad1 + d4a3e1c commit c715356

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

line_profiler/line_profiler.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,12 @@ def add_module(self, mod):
220220
def is_ipython_kernel_cell(filename):
221221
""" Return True if a filename corresponds to a Jupyter Notebook cell
222222
"""
223+
filename = os.path.normcase(filename)
224+
temp_dir = os.path.normcase(tempfile.gettempdir())
223225
return (
224226
filename.startswith('<ipython-input-') or
225-
filename.startswith(os.path.join(tempfile.gettempdir(), 'ipykernel_')) or
226-
filename.startswith(os.path.join(tempfile.gettempdir(), 'xpython_'))
227+
filename.startswith(os.path.join(temp_dir, 'ipykernel_')) or
228+
filename.startswith(os.path.join(temp_dir, 'xpython_'))
227229
)
228230

229231

0 commit comments

Comments
 (0)