Ignore symlinks when recompiling for :restart
Otherwise broken symlinks (*cough* emacs *cough*) cause this to fail with FileNotFoundError.
This commit is contained in:
parent
a5a4c17b1f
commit
9beb68bb5c
@ -497,7 +497,7 @@ class Quitter:
|
||||
|
||||
for dirpath, _dirnames, filenames in os.walk(path):
|
||||
for fn in filenames:
|
||||
if os.path.splitext(fn)[1] == '.py':
|
||||
if os.path.splitext(fn)[1] == '.py' and os.path.isfile(fn):
|
||||
with tokenize.open(os.path.join(dirpath, fn)) as f:
|
||||
compile(f.read(), fn, 'exec')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user