Commit 12471d63 authored by Guido van Rossum's avatar Guido van Rossum

Don't use self.announce() in a function that's not a method.

Use level=3 (i.e. log.WARN) for the warnings about failed imports.
(Hmm...  Why is that code in an "if 1: ..."?  What's the else branch
for?)
parent af160659
...@@ -88,7 +88,7 @@ def find_module_file(module, dirlist): ...@@ -88,7 +88,7 @@ def find_module_file(module, dirlist):
if not list: if not list:
return module return module
if len(list) > 1: if len(list) > 1:
self.announce("WARNING: multiple copies of %s found"%module) log.info("WARNING: multiple copies of %s found"%module)
return os.path.join(list[0], module) return os.path.join(list[0], module)
class PyBuildExt(build_ext): class PyBuildExt(build_ext):
...@@ -211,7 +211,7 @@ class PyBuildExt(build_ext): ...@@ -211,7 +211,7 @@ class PyBuildExt(build_ext):
if 1: if 1:
self.announce('*** WARNING: renaming "%s" since importing it' self.announce('*** WARNING: renaming "%s" since importing it'
' failed: %s' % (ext.name, why)) ' failed: %s' % (ext.name, why), level=3)
assert not self.inplace assert not self.inplace
basename, tail = os.path.splitext(ext_filename) basename, tail = os.path.splitext(ext_filename)
newname = basename + "_failed" + tail newname = basename + "_failed" + tail
...@@ -231,7 +231,7 @@ class PyBuildExt(build_ext): ...@@ -231,7 +231,7 @@ class PyBuildExt(build_ext):
self.announce('unable to remove files (ignored)') self.announce('unable to remove files (ignored)')
else: else:
self.announce('*** WARNING: importing extension "%s" ' self.announce('*** WARNING: importing extension "%s" '
'failed: %s' % (ext.name, why)) 'failed: %s' % (ext.name, why), level=3)
def get_platform (self): def get_platform (self):
# Get value of sys.platform # Get value of sys.platform
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment