]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Pylint: examples: fix redefined sys from outer scope error
authorMartin <martin.basti@gmail.com>
Sat, 2 Jul 2016 20:38:16 +0000 (22:38 +0200)
committerMartin <martin.basti@gmail.com>
Sat, 2 Jul 2016 20:38:22 +0000 (22:38 +0200)
This was more false positive than actual error, but I replaced sys.exit() by SystemExit exception  rather than disabling check there

examples/zonediff.py

index be0385189370876461bcdedd26d677c54b4bb6ef..99cf46a713f5033ac62fb047efa56a995d6c1352 100755 (executable)
@@ -28,9 +28,8 @@ __all__ = ['diff_zones', 'format_changes_plain', 'format_changes_html']
 try:
     import dns.zone
 except ImportError:
-    import sys
-    sys.stderr.write("Please install dnspython")
-    sys.exit(1)
+    raise SystemExit("Please install dnspython")
+
 
 def diff_zones(zone1, zone2, ignore_ttl=False, ignore_soa=False):
     """diff_zones(zone1, zone2, ignore_ttl=False, ignore_soa=False) -> changes