We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d9d9ad1 + d4a3e1c commit c715356Copy full SHA for c715356
line_profiler/line_profiler.py
@@ -220,10 +220,12 @@ def add_module(self, mod):
220
def is_ipython_kernel_cell(filename):
221
""" Return True if a filename corresponds to a Jupyter Notebook cell
222
"""
223
+ filename = os.path.normcase(filename)
224
+ temp_dir = os.path.normcase(tempfile.gettempdir())
225
return (
226
filename.startswith('<ipython-input-') or
- filename.startswith(os.path.join(tempfile.gettempdir(), 'ipykernel_')) or
- 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_'))
229
)
230
231
0 commit comments