mirror of
https://github.com/django/django.git
synced 2025-11-24 12:51:44 +00:00
[py3] Replaced basestring by six.string_types.
This commit is contained in:
parent
cacd845996
commit
3cb2457f46
73 changed files with 230 additions and 150 deletions
|
|
@ -71,7 +71,7 @@ class OGRGeometry(GDALBase):
|
|||
def __init__(self, geom_input, srs=None):
|
||||
"Initializes Geometry on either WKT or an OGR pointer as input."
|
||||
|
||||
str_instance = isinstance(geom_input, basestring)
|
||||
str_instance = isinstance(geom_input, six.string_types)
|
||||
|
||||
# If HEX, unpack input to to a binary buffer.
|
||||
if str_instance and hex_regex.match(geom_input):
|
||||
|
|
@ -283,7 +283,7 @@ class OGRGeometry(GDALBase):
|
|||
# (decremented) when this geometry's destructor is called.
|
||||
if isinstance(srs, SpatialReference):
|
||||
srs_ptr = srs.ptr
|
||||
elif isinstance(srs, six.integer_types + (basestring,)):
|
||||
elif isinstance(srs, six.integer_types + six.string_types):
|
||||
sr = SpatialReference(srs)
|
||||
srs_ptr = sr.ptr
|
||||
else:
|
||||
|
|
@ -412,7 +412,7 @@ class OGRGeometry(GDALBase):
|
|||
capi.geom_transform(self.ptr, coord_trans.ptr)
|
||||
elif isinstance(coord_trans, SpatialReference):
|
||||
capi.geom_transform_to(self.ptr, coord_trans.ptr)
|
||||
elif isinstance(coord_trans, six.integer_types + (basestring,)):
|
||||
elif isinstance(coord_trans, six.integer_types + six.string_types):
|
||||
sr = SpatialReference(coord_trans)
|
||||
capi.geom_transform_to(self.ptr, sr.ptr)
|
||||
else:
|
||||
|
|
@ -687,7 +687,7 @@ class GeometryCollection(OGRGeometry):
|
|||
for g in geom: capi.add_geom(self.ptr, g.ptr)
|
||||
else:
|
||||
capi.add_geom(self.ptr, geom.ptr)
|
||||
elif isinstance(geom, basestring):
|
||||
elif isinstance(geom, six.string_types):
|
||||
tmp = OGRGeometry(geom)
|
||||
capi.add_geom(self.ptr, tmp.ptr)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue