summaryrefslogtreecommitdiff
path: root/distutils2/compat.py
diff options
context:
space:
mode:
author?ric Araujo <merwok@netwok.org>2011-09-21 16:31:52 +0200
committer?ric Araujo <merwok@netwok.org>2011-09-21 16:31:52 +0200
commit4817cda16f1bb3edbfb3d289c551af974bd63e69 (patch)
treeadbba29ac54ae68693a25b418a1657a5953c1257 /distutils2/compat.py
parent7a1a23c8d45c2422097993106581df5c5da2f64c (diff)
downloaddisutils2-4817cda16f1bb3edbfb3d289c551af974bd63e69.tar.gz
pep8 compat.py
Diffstat (limited to 'distutils2/compat.py')
-rw-r--r--distutils2/compat.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/distutils2/compat.py b/distutils2/compat.py
index 8e4bc81..a64379c 100644
--- a/distutils2/compat.py
+++ b/distutils2/compat.py
@@ -74,6 +74,7 @@ except NameError:
_cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
+
def _get_normal_name(orig_enc):
"""Imitates get_normal_name in tokenizer.c."""
# Only care about the first 12 characters.
@@ -85,6 +86,7 @@ def _get_normal_name(orig_enc):
return "iso-8859-1"
return orig_enc
+
def detect_encoding(readline):
"""
The detect_encoding() function is used to detect the encoding that should
@@ -105,6 +107,7 @@ def detect_encoding(readline):
bom_found = False
encoding = None
default = 'utf-8'
+
def read_or_stop():
try:
return readline()
@@ -168,7 +171,8 @@ def fsencode(filename):
elif isinstance(filename, unicode):
return filename.encode(sys.getfilesystemencoding())
else:
- raise TypeError("expect bytes or str, not %s" % type(filename).__name__)
+ raise TypeError("expect bytes or str, not %s" %
+ type(filename).__name__)
try: