summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2012-08-10 18:53:54 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2012-08-10 18:53:54 (GMT)
commit731d48a65f4cfc6d99e7ec9bf0debd4080bf6eb0 (patch)
tree25459ef1d1106fd60d8369cb8dafb46df5c55b0f /Lib/importlib
parentac9f2f3de31787a016a1220b304db388dc1705e9 (diff)
downloadcpython-731d48a65f4cfc6d99e7ec9bf0debd4080bf6eb0.zip
cpython-731d48a65f4cfc6d99e7ec9bf0debd4080bf6eb0.tar.gz
cpython-731d48a65f4cfc6d99e7ec9bf0debd4080bf6eb0.tar.bz2
update docstring per the extension package fix, refactor
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 3562dfb..b79fdcc 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1102,13 +1102,10 @@ class ExtensionFileLoader:
raise
def is_package(self, fullname):
- """Return False as an extension module can never be a package."""
+ """Return if the extension module is a package."""
file_name = _path_split(self.path)[1]
- for suffix in EXTENSION_SUFFIXES:
- if file_name == '__init__' + suffix:
- return True
- else:
- return False
+ return any(file_name == '__init__' + suffix
+ for suffix in EXTENSION_SUFFIXES)
def get_code(self, fullname):
"""Return None as an extension module cannot create a code object."""