Remove the private Scripting._can_distclean function

This commit is contained in:
Thomas Nagy 2016-04-27 18:42:38 +02:00
parent bc3915c90a
commit 09f67a3b3a
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
2 changed files with 3 additions and 10 deletions

View File

@ -269,13 +269,6 @@ def run_commands():
###########################################################################################
def _can_distclean(name):
# WARNING: this method may disappear anytime
for k in '.o .moc .exe'.split():
if name.endswith(k):
return True
return False
def distclean_dir(dirname):
"""
Distclean function called in the particular case when::
@ -287,7 +280,7 @@ def distclean_dir(dirname):
"""
for (root, dirs, files) in os.walk(dirname):
for f in files:
if _can_distclean(f):
if f.endswith(('.o', '.moc', '.exe')):
fname = os.path.join(root, f)
try:
os.remove(fname)
@ -559,7 +552,7 @@ class DistCheck(Dist):
instdir = tempfile.mkdtemp('.inst', self.get_base_name())
ret = Utils.subprocess.Popen([sys.executable, sys.argv[0], 'configure', 'install', 'uninstall', '--destdir=' + instdir] + cfg, cwd=self.get_base_name()).wait()
if ret:
raise Errors.WafError('distcheck failed with code %i' % ret)
raise Errors.WafError('distcheck failed with code %r' % ret)
if os.path.exists(instdir):
raise Errors.WafError('distcheck succeeded, but files were left in %s' % instdir)

View File

@ -458,7 +458,7 @@ def check_python_version(conf, minver=None):
cmd = pybin + ['-c', 'import sys\nfor x in sys.version_info: print(str(x))']
Logs.debug('python: Running python command %r', cmd)
lines = conf.cmd_and_log(cmd).split()
assert len(lines) == 5, "found %i lines, expected 5: %r" % (len(lines), lines)
assert len(lines) == 5, "found %r lines, expected 5: %r" % (len(lines), lines)
pyver_tuple = (int(lines[0]), int(lines[1]), int(lines[2]), lines[3], int(lines[4]))
# compare python version with the minimum required