summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMartin <martin.basti@gmail.com>2016-07-02 22:35:31 +0200
committerMartin <martin.basti@gmail.com>2016-07-02 22:35:31 +0200
commit0c42b263cfd02d1cf5feb511162f8624060d6fa3 (patch)
tree1431400a44d16bc4382e41bb1ece21d8d048b0b1 /examples
parent6f52d99ec052fe937a93bbca07deaf95dd9cb5a4 (diff)
downloaddnspython-0c42b263cfd02d1cf5feb511162f8624060d6fa3.tar.gz
Pylint: examples: fix basestring is not in py3
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/zonediff.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/zonediff.py b/examples/zonediff.py
index 6afa362..be03851 100755
--- a/examples/zonediff.py
+++ b/examples/zonediff.py
@@ -192,15 +192,7 @@ The differences shown will be logical differences, not textual differences.
opts.use_vc = opts.use_git or opts.use_bzr or opts.use_rcs
def _open(what, err):
- if isinstance(what, basestring):
- # Open as normal file
- try:
- return open(what, 'rb')
- except:
- sys.stderr.write(err + "\n")
- if opts.tracebacks:
- traceback.print_exc()
- else:
+ if isinstance(what, list):
# Must be a list, open subprocess
try:
proc = subprocess.Popen(what, stdout=subprocess.PIPE)
@@ -212,6 +204,14 @@ The differences shown will be logical differences, not textual differences.
sys.stderr.write(err + "\n")
if opts.tracebacks:
traceback.print_exc()
+ else:
+ # Open as normal file
+ try:
+ return open(what, 'rb')
+ except:
+ sys.stderr.write(err + "\n")
+ if opts.tracebacks:
+ traceback.print_exc()
if not opts.use_vc and len(args) != 2:
p.print_help()