]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: Python 3 compat fixes for fs/misc/filelock_interrupt.py
authorAnirudha Bose <ani07nov@gmail.com>
Fri, 19 Aug 2016 05:23:53 +0000 (10:53 +0530)
committerAnirudha Bose <ani07nov@gmail.com>
Fri, 19 Aug 2016 05:52:26 +0000 (11:22 +0530)
Signed-off-by: Anirudha Bose <ani07nov@gmail.com>
qa/workunits/fs/misc/filelock_interrupt.py

index a17fa39e9dc621ffe242525660f8a36e264ea95f..3ce559e09c39f88c8d2422e124b8093b214e0ff2 100755 (executable)
@@ -29,7 +29,7 @@ def main():
     signal.alarm(5);
     try:
         fcntl.flock(f2, fcntl.LOCK_EX)
-    except IOError, e:
+    except IOError as e:
         if e.errno != errno.EINTR:
             raise
     else:
@@ -40,11 +40,11 @@ def main():
     lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 10, 0, 0)
     try:
         fcntl.fcntl(f1, fcntl.F_OFD_SETLK, lockdata)
-    except IOError, e:
+    except IOError as e:
         if e.errno != errno.EINVAL:
             raise
         else:
-            print 'kernel does not support fcntl.F_OFD_SETLK'
+            print('kernel does not support fcntl.F_OFD_SETLK')
             return
 
     lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 10, 10, 0, 0)
@@ -58,7 +58,7 @@ def main():
     try:
         lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
         fcntl.fcntl(f2, fcntl.F_OFD_SETLKW, lockdata)
-    except IOError, e:
+    except IOError as e:
         if e.errno != errno.EINTR:
             raise
     else:
@@ -70,7 +70,7 @@ def main():
     try:
         lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 10, 10, 0, 0)
         fcntl.fcntl(f1, fcntl.F_OFD_SETLK, lockdata)
-    except IOError, e:
+    except IOError as e:
         if e.errno == errno.EAGAIN:
             pass
     else:
@@ -80,6 +80,7 @@ def main():
     fcntl.fcntl(f1, fcntl.F_OFD_SETLK, lockdata)
     fcntl.fcntl(f2, fcntl.F_OFD_SETLK, lockdata)
 
-    print 'ok'
+    print('ok')
+
 
 main()