Loading django/contrib/gis/gdal/base.py +2 −2 Original line number Diff line number Diff line from ctypes import c_void_p from types import NoneType from django.contrib.gis.gdal.error import GDALException class GDALBase(object): Loading @@ -26,7 +26,7 @@ class GDALBase(object): # compatible type or None (NULL). if isinstance(ptr, (int, long)): self._ptr = self.ptr_type(ptr) elif isinstance(ptr, (self.ptr_type, NoneType)): elif ptr is None or isinstance(ptr, self.ptr_type): self._ptr = ptr else: raise TypeError('Incompatible pointer type') Loading django/contrib/gis/geos/base.py +2 −2 Original line number Diff line number Diff line from ctypes import c_void_p from types import NoneType from django.contrib.gis.geos.error import GEOSException # Trying to import GDAL libraries, if available. Have to place in Loading Loading @@ -41,7 +41,7 @@ class GEOSBase(object): def _set_ptr(self, ptr): # Only allow the pointer to be set with pointers of the # compatible type or None (NULL). if isinstance(ptr, (self.ptr_type, NoneType)): if ptr is None or isinstance(ptr, self.ptr_type): self._ptr = ptr else: raise TypeError('Incompatible pointer type') Loading django/utils/encoding.py +2 −3 Original line number Diff line number Diff line import types import urllib import locale import datetime Loading Loading @@ -45,7 +44,7 @@ def is_protected_type(obj): force_unicode(strings_only=True). """ return isinstance(obj, ( types.NoneType, type(None), int, long, datetime.datetime, datetime.date, datetime.time, float, Decimal) Loading Loading @@ -107,7 +106,7 @@ def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'): If strings_only is True, don't convert (some) non-string-like objects. """ if strings_only and isinstance(s, (types.NoneType, int)): if strings_only and (s is None or isinstance(s, int)): return s if isinstance(s, Promise): return unicode(s).encode(encoding, errors) Loading Loading
django/contrib/gis/gdal/base.py +2 −2 Original line number Diff line number Diff line from ctypes import c_void_p from types import NoneType from django.contrib.gis.gdal.error import GDALException class GDALBase(object): Loading @@ -26,7 +26,7 @@ class GDALBase(object): # compatible type or None (NULL). if isinstance(ptr, (int, long)): self._ptr = self.ptr_type(ptr) elif isinstance(ptr, (self.ptr_type, NoneType)): elif ptr is None or isinstance(ptr, self.ptr_type): self._ptr = ptr else: raise TypeError('Incompatible pointer type') Loading
django/contrib/gis/geos/base.py +2 −2 Original line number Diff line number Diff line from ctypes import c_void_p from types import NoneType from django.contrib.gis.geos.error import GEOSException # Trying to import GDAL libraries, if available. Have to place in Loading Loading @@ -41,7 +41,7 @@ class GEOSBase(object): def _set_ptr(self, ptr): # Only allow the pointer to be set with pointers of the # compatible type or None (NULL). if isinstance(ptr, (self.ptr_type, NoneType)): if ptr is None or isinstance(ptr, self.ptr_type): self._ptr = ptr else: raise TypeError('Incompatible pointer type') Loading
django/utils/encoding.py +2 −3 Original line number Diff line number Diff line import types import urllib import locale import datetime Loading Loading @@ -45,7 +44,7 @@ def is_protected_type(obj): force_unicode(strings_only=True). """ return isinstance(obj, ( types.NoneType, type(None), int, long, datetime.datetime, datetime.date, datetime.time, float, Decimal) Loading Loading @@ -107,7 +106,7 @@ def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'): If strings_only is True, don't convert (some) non-string-like objects. """ if strings_only and isinstance(s, (types.NoneType, int)): if strings_only and (s is None or isinstance(s, int)): return s if isinstance(s, Promise): return unicode(s).encode(encoding, errors) Loading