summaryrefslogtreecommitdiffstats
path: root/Lib/packaging
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-09-18 21:12:30 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-09-18 21:12:30 (GMT)
commitc1b7e7f8bbcae936a5e75277e9e86d9ebec5469f (patch)
tree8f179ac3234e344d366bce980199e0c4be71ca25 /Lib/packaging
parentf30b5ae6fd03b497a43d30489663a6baa9f2d800 (diff)
downloadcpython-c1b7e7f8bbcae936a5e75277e9e86d9ebec5469f.zip
cpython-c1b7e7f8bbcae936a5e75277e9e86d9ebec5469f.tar.gz
cpython-c1b7e7f8bbcae936a5e75277e9e86d9ebec5469f.tar.bz2
A few style changes originally done in the distutils2 repo
Diffstat (limited to 'Lib/packaging')
-rw-r--r--Lib/packaging/command/build_scripts.py4
-rw-r--r--Lib/packaging/create.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/packaging/command/build_scripts.py b/Lib/packaging/command/build_scripts.py
index fe14e0a..d651ae0 100644
--- a/Lib/packaging/command/build_scripts.py
+++ b/Lib/packaging/command/build_scripts.py
@@ -3,7 +3,7 @@
import os
import re
import sysconfig
-import tokenize
+from tokenize import detect_encoding
from packaging.command.cmd import Command
from packaging.util import convert_path, newer
@@ -83,7 +83,7 @@ class build_scripts(Command, Mixin2to3):
raise
f = None
else:
- encoding, lines = tokenize.detect_encoding(f.readline)
+ encoding, lines = detect_encoding(f.readline)
f.seek(0)
first_line = f.readline()
if not first_line:
diff --git a/Lib/packaging/create.py b/Lib/packaging/create.py
index 1e84e2e..34a8c82 100644
--- a/Lib/packaging/create.py
+++ b/Lib/packaging/create.py
@@ -25,10 +25,11 @@ import sys
import glob
import shutil
import sysconfig
-import tokenize
from hashlib import md5
from textwrap import dedent
+from tokenize import detect_encoding
from configparser import RawConfigParser
+
# importing this with an underscore as it should be replaced by the
# dict form or another structures for all purposes
from packaging._trove import all_classifiers as _CLASSIFIERS_LIST
@@ -111,7 +112,7 @@ def load_setup():
been loaded before, because we are monkey patching its setup function with
a particular one"""
with open("setup.py", "rb") as f:
- encoding, lines = tokenize.detect_encoding(f.readline)
+ encoding, lines = detect_encoding(f.readline)
with open("setup.py", encoding=encoding) as f:
imp.load_module("setup", f, "setup.py", (".py", "r", imp.PY_SOURCE))