From a93eda4deda5a510703e9b269de11c28add29ede Mon Sep 17 00:00:00 2001 From: Marcel Hellkamp Date: Sat, 14 Sep 2024 12:51:31 +0200 Subject: [PATCH] fix: Reloader choked on very old namespace modules. Namespace modules created with old versions of setuptools did not conform to spec . Those are still around, unfortunately. fixes #1455 --- bottle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bottle.py b/bottle.py index b5a76e8f..a3c759a7 100755 --- a/bottle.py +++ b/bottle.py @@ -3997,7 +3997,7 @@ def run(self): 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)