file: Use isinstance() instead of type()

This commit is contained in:
Fatih Aşıcı
2010-07-12 12:57:41 +00:00
parent 93ae13cbdc
commit 3927ad3173
+1 -2
View File
@@ -18,7 +18,6 @@ like all pisi classes, it has been programmed in a non-restrictive way
"""
import os
import types
import shutil
import gettext
@@ -59,7 +58,7 @@ class File:
@staticmethod
def make_uri(uri):
"handle URI arg"
if type(uri) == types.StringType or type(uri) == types.UnicodeType:
if isinstance(uri, basestring):
uri = pisi.uri.URI(uri)
elif not isinstance(uri, pisi.uri.URI):
raise Error(_("uri must have type either URI or string"))