]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport from trunk:
authorThomas Heller <theller@ctypes.org>
Fri, 22 Oct 2004 10:29:56 +0000 (10:29 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 22 Oct 2004 10:29:56 +0000 (10:29 +0000)
SF bug 917108:  warnings.py does not define _test().
Removed the entire __name__ == '__main__' block.

Lib/warnings.py

index c2bc06ee704878bd6d7d95db1d3c192a36c85337..397cec7278db10b219cd60a7f52a4eb5b9129fdf 100644 (file)
@@ -249,11 +249,6 @@ def _getcategory(category):
     return cat
 
 # Module initialization
-if __name__ == "__main__":
-    import __main__
-    sys.modules['warnings'] = __main__
-    _test()
-else:
-    _processoptions(sys.warnoptions)
-    simplefilter("ignore", category=OverflowWarning, append=1)
-    simplefilter("ignore", category=PendingDeprecationWarning, append=1)
+_processoptions(sys.warnoptions)
+simplefilter("ignore", category=OverflowWarning, append=1)
+simplefilter("ignore", category=PendingDeprecationWarning, append=1)