From 9a75657c1e3445fac205319d1d5255ca34eb7226 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Fri, 12 Feb 2016 13:24:09 -0800 Subject: [PATCH] be more like Python3 --- tldp/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tldp/utils.py b/tldp/utils.py index bdf4b24..65343bc 100644 --- a/tldp/utils.py +++ b/tldp/utils.py @@ -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)