From 847d61a0590037507e2dd6f7b06afffd1459edb3 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Thu, 17 May 2018 14:23:45 +0000 Subject: [PATCH] gnunet-chk.py: More 2to3 changes. Signed-off-by: Nils Gillmann --- contrib/gnunet-chk.py.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/gnunet-chk.py.in b/contrib/gnunet-chk.py.in index 0d07e6239..f20153a8a 100755 --- a/contrib/gnunet-chk.py.in +++ b/contrib/gnunet-chk.py.in @@ -192,6 +192,8 @@ class Chk: def setSize(self, size): self.fsize = size + # 2to3-3.5 suggests to change the code below to: + # if isinstance (self.fsize, int): def uri(self): sizestr = repr(self.fsize) if isinstance(self.fsize, long): @@ -367,7 +369,7 @@ Options: if '__main__' == __name__: try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) - except getopt.GetoptError, err: + except getopt.GetoptError as err: print(err) print("Exception occured") usage() @@ -380,4 +382,4 @@ if '__main__' == __name__: print("Incorrect number of arguments passed") usage() sys.exit(1) - print chkuri_from_path(args[0]) + print(chkuri_from_path(args[0])) -- 2.25.1