summaryrefslogtreecommitdiff
path: root/src/distutils2/command
diff options
context:
space:
mode:
authorTarek Ziade <tarek@ziade.org>2010-07-04 11:16:37 +0200
committerTarek Ziade <tarek@ziade.org>2010-07-04 11:16:37 +0200
commitb498d332a6e7103a8e88724ff849cf3fee9bae82 (patch)
treee00b53d315e4459d0511e5486156f6fa9c931845 /src/distutils2/command
parent9a8f3b5907cf0fc2471d6904d59c0b71543a1035 (diff)
downloaddisutils2-b498d332a6e7103a8e88724ff849cf3fee9bae82.tar.gz
Making sure the code works on all Python versions.
Also, fixed a few imports and logging usage.
Diffstat (limited to 'src/distutils2/command')
-rw-r--r--src/distutils2/command/build_py.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/distutils2/command/build_py.py b/src/distutils2/command/build_py.py
index 570d86e..1ea8a6d 100644
--- a/src/distutils2/command/build_py.py
+++ b/src/distutils2/command/build_py.py
@@ -28,14 +28,14 @@ except ImportError:
class Mixin2to3(_KLASS):
""" The base class which can be used for refactoring. When run under
- Python 3.0, the run_2to3 method provided by Mixin2to3 is overridden.
- When run on Python 2.x, it merely creates a class which overrides run_2to3,
- yet does nothing in particular with it.
+ Python 3.0, the run_2to3 method provided by Mixin2to3 is overridden.
+ When run on Python 2.x, it merely creates a class which overrides run_2to3,
+ yet does nothing in particular with it.
"""
if _CONVERT:
def _run_2to3(self, files, doctests=[]):
""" Takes a list of files and doctests, and performs conversion
- on those.
+ on those.
- First, the files which contain the code(`files`) are converted.
- Second, the doctests in `files` are converted.
- Thirdly, the doctests in `doctests` are converted.
@@ -53,7 +53,7 @@ class Mixin2to3(_KLASS):
# 1. User has specified the 'convert_2to3_doctests' option. So, we
# can expect that the list 'doctests' is not empty.
# 2. The default is allow distutils2 to allow conversion of text files
- # containing doctests. It is set as
+ # containing doctests. It is set as
# distutils2.run_2to3_on_doctests
if doctests != [] and distutils2.run_2to3_on_doctests:
@@ -258,8 +258,8 @@ class build_py(Command, Mixin2to3):
if os.path.isfile(init_py):
return init_py
else:
- log.warn(("package init file '%s' not found " +
- "(or not a regular file)"), init_py)
+ logging.warning(("package init file '%s' not found " +
+ "(or not a regular file)"), init_py)
# Either not in a package at all (__init__.py not expected), or
# __init__.py doesn't exist -- so don't return the filename.
@@ -267,7 +267,8 @@ class build_py(Command, Mixin2to3):
def check_module(self, module, module_file):
if not os.path.isfile(module_file):
- log.warn("file %s (for module %s) not found", module_file, module)
+ logging.warning("file %s (for module %s) not found",
+ module_file, module)
return False
else:
return True