From 9beb68bb5c8310b02a65e1aa7906047af080b867 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Jun 2016 12:56:37 +0200 Subject: [PATCH] Ignore symlinks when recompiling for :restart Otherwise broken symlinks (*cough* emacs *cough*) cause this to fail with FileNotFoundError. --- qutebrowser/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index d422e1208..c9a1eac37 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -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')