diff --git a/thinc/neural/util.py b/thinc/neural/util.py
index <HASH>..<HASH> 100644
--- a/thinc/neural/util.py
+++ b/thinc/neural/util.py
@@ -52,12 +52,14 @@ def copy_array(dst, src, casting='same_kind', where=None):
     else:
         numpy.copyto(dst, src)
 
-
 def ensure_path(path):
-    if isinstance(path, basestring) or isinstance(path, str):
-        return Path(path)
-    else:
-        return path
+    try:
+        if isinstance(path, basestring) or isinstance(path, str):
+            return Path(path)
+    except NameError:
+        if isinstance(path, str):
+            return Path(path)
+    return path
 
 
 def to_categorical(y, nb_classes=None):
Try/Except around use of basestring that doesn't exist in python3