summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distutils/core.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/distutils/core.py b/distutils/core.py
index 6be58b26..15ddcf80 100644
--- a/distutils/core.py
+++ b/distutils/core.py
@@ -224,9 +224,8 @@ def run_setup (script_name, script_args=None, stop_after="run"):
sys.argv[0] = script_name
if script_args is not None:
sys.argv[1:] = script_args
- _open = getattr(tokenize, 'open', open)
- # ^-- tokenize.open supports automatic encoding detection
- with _open(script_name) as f:
+ # tokenize.open supports automatic encoding detection
+ with tokenize.open(script_name) as f:
code = f.read().replace(r'\r\n', r'\n')
exec(code, g)
finally: