icinga2-list-objects: Improve compatibility with Python 2.4

refs #6702
This commit is contained in:
Gunnar Beutner 2014-08-17 13:31:24 +02:00
parent 4bfd6f9e23
commit 0ec5efafb5
1 changed files with 2 additions and 1 deletions

View 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()