be more like Python3

This commit is contained in:
Martin A. Brown 2016-02-12 13:24:09 -08:00
parent 7c70a7c4b8
commit 9a75657c1e
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
from __future__ import absolute_import, division, print_function
import os
import io
import sys
import logging
@ -37,7 +38,7 @@ http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/37
def makefh(thing):
if isinstance(thing, file):
if isinstance(thing, io.IOBase):
f = thing
elif isinstance(thing, str) and os.path.isfile(thing):
f = open(thing)