summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-12-04 19:44:30 (GMT)
committerBarry Warsaw <barry@python.org>1997-12-04 19:44:30 (GMT)
commit90136b08b680a90f4962fabf7bf63a9c9a3a1753 (patch)
tree0d34d5990a116c5bab734c7f694f2b5638bb3af9 /Tools
parent00727b00228df0c72918af983e490d781a7a41e8 (diff)
downloadcpython-90136b08b680a90f4962fabf7bf63a9c9a3a1753.zip
cpython-90136b08b680a90f4962fabf7bf63a9c9a3a1753.tar.gz
cpython-90136b08b680a90f4962fabf7bf63a9c9a3a1753.tar.bz2
Only parsing requires Python 1.5
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/world/world13
1 files changed, 7 insertions, 6 deletions
diff --git a/Tools/world/world b/Tools/world/world
index 01ec4c2..e973ade 100755
--- a/Tools/world/world
+++ b/Tools/world/world
@@ -1,4 +1,4 @@
-#! /usr/bin/env python1.5
+#! /usr/bin/env python
"""Print the long name of an Internet domain.
@@ -51,11 +51,6 @@ __source__ = '<url:http://www.python.org/~bwarsaw/pyware/>'
import sys
import string
import getopt
-try:
- import re
-except ImportError:
- print 'Python 1.5 is required!'
- sys.exit(1)
@@ -81,6 +76,12 @@ def resolve(rawaddr):
def parse(file, normalize):
try:
+ import re
+ except ImportError:
+ print 'Parsing requires Python 1.5'
+ sys.exit(1)
+
+ try:
fp = open(file)
except IOError, (err, msg):
print msg, ':', file