From 731d48a65f4cfc6d99e7ec9bf0debd4080bf6eb0 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Fri, 10 Aug 2012 11:53:54 -0700 Subject: update docstring per the extension package fix, refactor --- Lib/importlib/_bootstrap.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Lib/importlib/_bootstrap.py') diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 3562dfb888..b79fdcccad 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.""" -- cgit v1.2.1