aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make-tap-reg.py
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-08-02 00:22:51 +0000
committerGerald Combs <gerald@wireshark.org>2013-08-02 00:22:51 +0000
commit2336eb9919e20de306b29ab34d1ca12550930f4a (patch)
tree1be51479939f4e8fe5ce86d8cd361c121b368390 /tools/make-tap-reg.py
parente6202124eb4218f786a0ff2689564bf0d4e27c55 (diff)
Make sure we're compatible with Python 2 + 3. Tested with Pythons 2.5,
2.7, and 3.3. svn path=/trunk/; revision=51106
Diffstat (limited to 'tools/make-tap-reg.py')
-rwxr-xr-xtools/make-tap-reg.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/make-tap-reg.py b/tools/make-tap-reg.py
index c038485ebf..e9c8a5f31f 100755
--- a/tools/make-tap-reg.py
+++ b/tools/make-tap-reg.py
@@ -35,7 +35,7 @@ elif registertype == "tshark-taps":
final_filename = "tshark-tap-register.c"
cache_filename = "tshark-tap-register-cache.pkl"
else:
- print "Unknown output type '%s'" % registertype
+ print("Unknown output type '%s'" % registertype)
sys.exit(1)
@@ -53,7 +53,7 @@ for file in files:
filenames.append("%s/%s" % (srcdir, file))
if len(filenames) < 1:
- print "No files found"
+ print("No files found")
sys.exit(1)
@@ -89,7 +89,7 @@ if cache_filename:
for filename in filenames:
file = open(filename)
cur_mtime = os.fstat(file.fileno())[ST_MTIME]
- if cache and cache.has_key(filename):
+ if cache and filename in cache:
cdict = cache[filename]
if cur_mtime == cdict['mtime']:
# print "Pulling %s from cache" % (filename)
@@ -123,7 +123,7 @@ if cache is not None and cache_filename is not None:
# Make sure we actually processed something
if len(regs['tap_reg']) < 1:
- print "No protocol registrations found"
+ print("No protocol registrations found")
sys.exit(1)
# Sort the lists to make them pretty