[Python-checkins] distutils2: added a test that covers the error Brian found

tarek.ziade python-checkins at python.org
Tue Apr 13 02:31:37 CEST 2010

tarek.ziade pushed fe95d3101e3b to distutils2:

changeset:   120:fe95d3101e3b
tag:         tip
user:        Tarek Ziade <tarek at ziade.org>
date:        Tue Apr 13 02:31:30 2010 +0200
summary:     added a test that covers the error Brian found
files:       src/distutils2/tests/test_util.py, src/distutils2/util.py

diff --git a/src/distutils2/tests/test_util.py b/src/distutils2/tests/test_util.py
--- a/src/distutils2/tests/test_util.py
+++ b/src/distutils2/tests/test_util.py
@@ -6,7 +6,10 @@
 from StringIO import StringIO
 import subprocess
-from distutils2.errors import DistutilsPlatformError, DistutilsByteCompileError
+from distutils2.errors import (DistutilsPlatformError,
+                               DistutilsByteCompileError,
+                               DistutilsFileError)
 from distutils2.util import (convert_path, change_root,
                             check_environ, split_quoted, strtobool,
                             rfc822_escape, get_compiler_versions,
@@ -250,6 +253,10 @@
             sys.dont_write_bytecode = old_dont_write_bytecode
+    def test_newer(self):
+        self.assertRaises(DistutilsFileError, util.newer, 'xxx', 'xxx')
 def test_suite():
     return unittest2.makeSuite(UtilTestCase)
diff --git a/src/distutils2/util.py b/src/distutils2/util.py
--- a/src/distutils2/util.py
+++ b/src/distutils2/util.py
@@ -8,11 +8,10 @@
 import sys, os, string, re
-from distutils2.errors import DistutilsPlatformError, DistutilsFileError
+from distutils2.errors import (DistutilsPlatformError, DistutilsFileError,
+                               DistutilsByteCompileError)
 from distutils2.spawn import spawn, find_executable
 from distutils2 import log
-from distutils2.errors import DistutilsByteCompileError
 from distutils2._backport import sysconfig as _sysconfig

Repository URL: http://hg.python.org/distutils2

More information about the Python-checkins mailing list