summaryrefslogtreecommitdiff
path: root/src/test_pychecker.py
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2010-06-15 14:28:28 +0000
committerLuca Falavigna <dktrkranz@debian.org>2010-06-15 14:28:28 +0000
commit0ed55e71a9f4b9cda836c6a4a5408cece60db0c6 (patch)
treeb1e82f6e428ac15ed9b4de93e48d8079420d537d /src/test_pychecker.py
parentfe00e4f75ba00298c30d6854b245c2a42c6542b8 (diff)
parent738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (diff)
Merge commit 'upstream/2.0.0'
Diffstat (limited to 'src/test_pychecker.py')
-rw-r--r--src/test_pychecker.py28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/test_pychecker.py b/src/test_pychecker.py
index e6efcb8..b4cf685 100644
--- a/src/test_pychecker.py
+++ b/src/test_pychecker.py
@@ -20,9 +20,8 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "src/test_pychecker.py 4720 2010/03/24 03:14:11 jars"
+__revision__ = "src/test_pychecker.py 5023 2010/06/14 22:05:46 scons"
"""
Use pychecker to catch various Python coding errors.
@@ -30,7 +29,6 @@ Use pychecker to catch various Python coding errors.
import os
import os.path
-import string
import sys
import TestSCons
@@ -64,21 +62,16 @@ else:
src_engine_ = os.path.join(src_engine, '')
MANIFEST = os.path.join(src_engine, 'MANIFEST.in')
-files = string.split(open(MANIFEST).read())
+files = open(MANIFEST).read().split()
-files = filter(lambda f: f[-3:] == '.py', files)
+files = [f for f in files if f[-3:] == '.py']
ignore = [
'SCons/compat/__init__.py',
'SCons/compat/_scons_UserString.py',
'SCons/compat/_scons_hashlib.py',
- 'SCons/compat/_scons_itertools.py',
- 'SCons/compat/_scons_optparse.py',
'SCons/compat/_scons_sets.py',
- 'SCons/compat/_scons_sets15.py',
- 'SCons/compat/_scons_shlex.py',
'SCons/compat/_scons_subprocess.py',
- 'SCons/compat/_scons_textwrap.py',
'SCons/compat/builtins.py',
]
@@ -90,10 +83,7 @@ for file in ignore:
del u[file]
except KeyError:
pass
-
-files = u.keys()
-
-files.sort()
+files = sorted(u.keys())
mismatches = []
@@ -131,15 +121,15 @@ for file in files:
test.run(program=program, arguments=args, status=None, stderr=None)
stdout = test.stdout()
- stdout = string.replace(stdout, src_engine_, '')
+ stdout = stdout.replace(src_engine_, '')
stderr = test.stderr()
- stderr = string.replace(stderr, src_engine_, '')
- stderr = string.replace(stderr, pywintypes_warning, '')
+ stderr = stderr.replace(src_engine_, '')
+ stderr = stderr.replace(pywintypes_warning, '')
if test.status or stdout or stderr:
mismatches.append('\n')
- mismatches.append(string.join([program] + args) + '\n')
+ mismatches.append(' '.join([program] + args) + '\n')
mismatches.append('STDOUT =====================================\n')
mismatches.append(stdout)
@@ -149,7 +139,7 @@ for file in files:
mismatches.append(stderr)
if mismatches:
- print string.join(mismatches[1:], '')
+ print ''.join(mismatches[1:])
test.fail_test()
test.pass_test()