diff Lib/UserString.py @ 24442:226ba34bd998 legacy-trunk

Complete the absolute import patch for the test suite. All relative imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
author Barry Warsaw <barry@python.org>
date Tue, 30 Jul 2002 23:27:12 +0000
parents cdd5c751823c
children 274e42a691e0
line wrap: on
line diff
--- a/Lib/UserString.py	Tue Jul 30 20:19:58 2002 +0000
+++ b/Lib/UserString.py	Tue Jul 30 23:27:12 2002 +0000
@@ -173,10 +173,8 @@
     # execute the regression test to stdout, if called as a script:
     import os
     called_in_dir, called_as = os.path.split(sys.argv[0])
-    called_in_dir = os.path.abspath(called_in_dir)
     called_as, py = os.path.splitext(called_as)
-    sys.path.append(os.path.join(called_in_dir, 'test'))
     if '-q' in sys.argv:
-        import test_support
+        from test import test_support
         test_support.verbose = 0
-    __import__('test_' + called_as.lower())
+    __import__('test.test_' + called_as.lower())