dataimport/csv.py
changeset 10612 84468b90e9c1
parent 10589 7c23b7de2b8d
child 10669 155c29e0ed1c
--- a/dataimport/csv.py	Wed Sep 16 11:23:51 2015 +0200
+++ b/dataimport/csv.py	Mon Sep 14 16:03:07 2015 +0200
@@ -22,11 +22,13 @@
 import warnings
 import os.path as osp
 
+from six import string_types
+
 from logilab.common import shellutils
 
 
 def count_lines(stream_or_filename):
-    if isinstance(stream_or_filename, basestring):
+    if isinstance(stream_or_filename, string_types):
         f = open(stream_or_filename)
     else:
         f = stream_or_filename
@@ -47,7 +49,7 @@
     if quote is not None:
         quotechar = quote
         warnings.warn("[3.20] 'quote' kwarg is deprecated, use 'quotechar' instead")
-    if isinstance(stream_or_path, basestring):
+    if isinstance(stream_or_path, string_types):
         if not osp.exists(stream_or_path):
             raise Exception("file doesn't exists: %s" % stream_or_path)
         stream = open(stream_or_path)