Skip to content

Commit

Permalink
fix bad remove of encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
apisu authored and apisu committed Dec 7, 2017
1 parent c2ec3b8 commit f7abd88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/cohorte/repositories/python/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Repository beans
# ------------------------------------------------------------------------------
# Bundle version
__version__=cohorte.version.__version__
__version__ = cohorte.version.__version__

# ------------------------------------------------------------------------------

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit f7abd88

Please sign in to comment.