diff options
author | Guido van Rossum <guido@python.org> | 1992-01-01 19:30:14 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-01-01 19:30:14 (GMT) |
commit | d4e5a733b2c8d692dff11696647731806c2818d6 (patch) | |
tree | 125d157ee239a9235bb6e610f964db123f70073e /Lib/importall.py | |
parent | 318a91c3f2b33b79999965c52fb412ff0c971bef (diff) | |
download | cpython-d4e5a733b2c8d692dff11696647731806c2818d6.zip cpython-d4e5a733b2c8d692dff11696647731806c2818d6.tar.gz cpython-d4e5a733b2c8d692dff11696647731806c2818d6.tar.bz2 |
Cosmetic changes; sabotage 'go' and 'stdwin'; New == syntax.
Diffstat (limited to 'Lib/importall.py')
-rwxr-xr-x | Lib/importall.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/importall.py b/Lib/importall.py index 57e6821..469e9c6 100755 --- a/Lib/importall.py +++ b/Lib/importall.py @@ -14,6 +14,10 @@ except ImportError: import sys +# Sabotage 'gl' and 'stdwin' to prevent windows popping up... +for m in 'gl', 'stdwin', 'fl', 'fm': + sys.modules[m] = sys + exceptions = ['importall'] for dir in sys.path: @@ -26,10 +30,15 @@ for dir in sys.path: names.sort() for name in names: head, tail = name[:-3], name[-3:] - if tail = '.py' and head not in exceptions: + if tail == '.py' and head not in exceptions: s = 'import ' + head print s try: exec(s + '\n') + except KeyboardInterrupt: + del names[:] + print '\n[interrupt]' + break except: - print 'Sorry:', sys.exc_type, sys.exc_value + print 'Sorry:', sys.exc_type + ':', + print sys.exc_value |