diff --git a/scalene/scalene_analysis.py b/scalene/scalene_analysis.py index 87d83721a..26b8c67f4 100644 --- a/scalene/scalene_analysis.py +++ b/scalene/scalene_analysis.py @@ -31,6 +31,9 @@ def is_native(package_name: str) -> bool: except AttributeError: # No __file__, meaning it's built-in. Let's call it native. result = True + except TypeError: + # __file__ is there, but empty (os.path.dirname() returns TypeError). Let's call it native. + result = True except ModuleNotFoundError: # This module is not installed; fail gracefully. result = False