Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 8a11d28

Browse files
xinghuadou-googleXinghua Dou
authored andcommitted
Handle cases where module.__file__ is set to None.
I don't know why this would be the case, namespace modules don't have a __file__ attribute at all when I tried it, but they should just be skipped anyway. #4 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191100585
1 parent 0fababa commit 8a11d28

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/googleclouddebugger/module_utils2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def GetLoadedModuleBySuffix(path):
5757
"""
5858
root = os.path.splitext(path)[0]
5959
for module in sys.modules.values():
60-
mod_root = os.path.splitext(getattr(module, '__file__', ''))[0]
60+
mod_root = os.path.splitext(getattr(module, '__file__', None) or '')[0]
6161

6262
if not mod_root:
6363
continue

0 commit comments

Comments
 (0)