From f7abd88e071c385949f4530c12f4d373cec06013 Mon Sep 17 00:00:00 2001 From: apisu Date: Thu, 7 Dec 2017 13:46:51 +0100 Subject: [PATCH] fix bad remove of encoding --- python/cohorte/repositories/python/modules.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/cohorte/repositories/python/modules.py b/python/cohorte/repositories/python/modules.py index 0df09a8f..e1125de6 100755 --- a/python/cohorte/repositories/python/modules.py +++ b/python/cohorte/repositories/python/modules.py @@ -45,7 +45,7 @@ # Repository beans # ------------------------------------------------------------------------------ # Bundle version -__version__=cohorte.version.__version__ +__version__ = cohorte.version.__version__ # ------------------------------------------------------------------------------ @@ -185,7 +185,7 @@ def _extract_module_info(filename, module_name, is_package): :raise ValueError: Unreadable file """ try: - with open(filename,="utf-8") as filep: + with open(filename, encoding="utf-8") as filep: source = filep.read() except (OSError, IOError) as ex: raise ValueError("Error reading {0}: {1}".format(filename, ex)) @@ -293,7 +293,7 @@ def __compute_name(root, filename): # Drop extension filename = os.path.splitext(filename)[0] name_parts = filename.split(os.path.sep) - is_package = name_parts[len(name_parts)-1] == "__init__" + is_package = name_parts[len(name_parts) - 1] == "__init__" if is_package: name_parts = name_parts[:-1] return ".".join(name_parts), is_package @@ -562,7 +562,7 @@ def load_cache(self): for directory in cache["directories"]: self._directory_package[directory["dir_name"]] \ - = directory["pkg_name"] + = directory["pkg_name"] return True except (IOError, ValueError):