mirror of
https://github.com/archlinux/aur.git
synced 2026-02-13 03:21:27 +01:00
20 lines
583 B
Diff
20 lines
583 B
Diff
diff --git a/mitogen/master.py b/mitogen/master.py
|
|
index 4fb535f0..e069902d 100644
|
|
--- a/mitogen/master.py
|
|
+++ b/mitogen/master.py
|
|
@@ -136,8 +136,14 @@ def is_stdlib_name(modname):
|
|
if module is None:
|
|
return False
|
|
|
|
+ try:
|
|
+ import importlib
|
|
+ return modname in importlib.sys.stdlib_module_names
|
|
+ except ImportError:
|
|
+ pass
|
|
+
|
|
# six installs crap with no __file__
|
|
- modpath = os.path.abspath(getattr(module, '__file__', ''))
|
|
+ modpath = os.path.abspath(getattr(module, '__file__', '') or '')
|
|
return is_stdlib_path(modpath)
|
|
|
|
|