summaryrefslogtreecommitdiff
path: root/Lib/distutils/extension.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-06-03 11:17:15 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-06-03 11:17:15 +0000
commit68407219b75e618fcdfab2ba32f62e985cf1c28d (patch)
treec3a6913bc814946f54553739fb55a614d347a776 /Lib/distutils/extension.py
parente6ed2f9ea03af5caedf656945ad68141ffe34d5a (diff)
downloadcpython-git-68407219b75e618fcdfab2ba32f62e985cf1c28d.tar.gz
Merged revisions 73170 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73170 | tarek.ziade | 2009-06-03 13:12:08 +0200 (Wed, 03 Jun 2009) | 1 line more cleanup and test coverage for distutils.extension ........
Diffstat (limited to 'Lib/distutils/extension.py')
-rw-r--r--Lib/distutils/extension.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py
index a4054ff454..16d2bef6f4 100644
--- a/Lib/distutils/extension.py
+++ b/Lib/distutils/extension.py
@@ -5,12 +5,9 @@ modules in setup scripts."""
__revision__ = "$Id$"
-import os, sys
-
-try:
- import warnings
-except ImportError:
- warnings = None
+import os
+import sys
+import warnings
# This class is really only used by the "build_ext" command, so it might
# make sense to put it in distutils.command.build_ext. However, that
@@ -129,14 +126,11 @@ class Extension:
self.optional = optional
# If there are unknown keyword options, warn about them
- if len(kw):
- L = map(repr, sorted(kw))
- msg = "Unknown Extension options: " + ', '.join(L)
- if warnings is not None:
- warnings.warn(msg)
- else:
- sys.stderr.write(msg + '\n')
-
+ if len(kw) > 0:
+ options = [repr(option) for option in kw]
+ options = ', '.join(sorted(options))
+ msg = "Unknown Extension options: %s" % options
+ warnings.warn(msg)
def read_setup_file(filename):
"""Reads a Setup file and returns Extension instances."""