Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f89bb70 commit 89dc552Copy full SHA for 89dc552
1 file changed
IPython/utils/path.py
@@ -83,12 +83,13 @@ def get_py_filename(name):
83
"""
84
85
name = os.path.expanduser(name)
86
- if not os.path.isfile(name) and not name.endswith('.py'):
87
- name += '.py'
88
if os.path.isfile(name):
89
return name
90
- else:
91
- raise IOError('File `%r` not found.' % name)
+ if not name.endswith('.py'):
+ py_name = name + '.py'
+ if os.path.isfile(py_name):
+ return py_name
92
+ raise IOError('File `%r` not found.' % name)
93
94
95
def filefind(filename: str, path_dirs=None) -> str:
0 commit comments