Commit 55853615 authored by Jérome Perrin's avatar Jérome Perrin

analyze: minor syntax tweaks for python3 compatibility

parent 7d24147b
...@@ -31,7 +31,7 @@ class DeltaFileStorage( ...@@ -31,7 +31,7 @@ class DeltaFileStorage(
pass pass
class DeltaFileIterator(FileIterator): class DeltaFileIterator(FileIterator):
def __init__(self, filename, start=None, stop=None, pos=0L): def __init__(self, filename, start=None, stop=None, pos=0):
assert isinstance(filename, str) assert isinstance(filename, str)
file = open(filename, 'rb') file = open(filename, 'rb')
self._file = file self._file = file
...@@ -241,7 +241,7 @@ def analyze_rec(report, record): ...@@ -241,7 +241,7 @@ def analyze_rec(report, record):
report.CBYTESMAP[type] = report.CBYTESMAP.get(type, 0) + size - fsize report.CBYTESMAP[type] = report.CBYTESMAP.get(type, 0) + size - fsize
report.TYPEMAP[type] = report.TYPEMAP.get(type, 0) + 1 report.TYPEMAP[type] = report.TYPEMAP.get(type, 0) + 1
report.TYPESIZE[type] = report.TYPESIZE.get(type, 0) + size report.TYPESIZE[type] = report.TYPESIZE.get(type, 0) + size
except Exception, err: except Exception as err:
print (err, file=sys.stderr) print (err, file=sys.stderr)
__doc__ = """%(program)s: Analyzer for ZODB data or repozo deltafs __doc__ = """%(program)s: Analyzer for ZODB data or repozo deltafs
...@@ -274,7 +274,7 @@ def main(argv): ...@@ -274,7 +274,7 @@ def main(argv):
opts, args = getopt.getopt(argv[1:], opts, args = getopt.getopt(argv[1:],
'hcd', ['help', 'csv', 'dbm']) 'hcd', ['help', 'csv', 'dbm'])
path = args[0] path = args[0]
except (getopt.GetoptError, IndexError), msg: except (getopt.GetoptError, IndexError) as msg:
usage(sys.stderr, msg) usage(sys.stderr, msg)
sys.exit(2) sys.exit(2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment