]> granicus.if.org Git - icinga2/commitdiff
icinga2-list-objects: Improve compatibility with Python 2.4
authorGunnar Beutner <gunnar.beutner@netways.de>
Sun, 17 Aug 2014 11:31:24 +0000 (13:31 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sun, 17 Aug 2014 11:31:24 +0000 (13:31 +0200)
refs #6702

python/icinga2/commands/list_objects.py

index e4622d18827a1aebe9855d1668cd9a24debdfbb5..bf8bca3b70fd2b568ecd413112ad10f263814cc8 100644 (file)
@@ -27,7 +27,8 @@ def main():
 
     try:
         opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "color"])
-    except getopt.GetoptError as err:
+    except getopt.GetoptError:
+        t, err = sys.exc_info()[:2]
         # print help information and exit:
         print str(err) # will print something like "option -a not recognized"
         usage()