summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2018-12-13 08:26:27 +0100
committerMarcel Hellkamp <marc@gsites.de>2018-12-13 08:26:27 +0100
commitc8179b28d93b2875a31866c6b84a9b5b59c0c8b4 (patch)
treed2ad16a94c6767a009ac1bed2d3c686ba7cc9429
parent5813b873a885094759178583f65cc0f0f2bc576b (diff)
downloadbottle-c8179b28d93b2875a31866c6b84a9b5b59c0c8b4.tar.gz
fix #1115: Some modules set __file__ as None
This is not allowed (the __file__ attribute MUST be either a string, or unset), but seems to happen anyway and is easy to work around in bottle.
-rwxr-xr-xbottle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index d233753..0b22f2e 100755
--- a/bottle.py
+++ b/bottle.py
@@ -3753,7 +3753,7 @@ class FileCheckerThread(threading.Thread):
files = dict()
for module in list(sys.modules.values()):
- path = getattr(module, '__file__', '')
+ path = getattr(module, '__file__', '') or ''
if path[-4:] in ('.pyo', '.pyc'): path = path[:-1]
if path and exists(path): files[path] = mtime(path)