Refs #34233 -- Used types.NoneType.

Available since Python 3.10 where it was reintroduced.
This commit is contained in:
Nick Pope 2023-01-18 16:27:23 +00:00 committed by GitHub
parent 26a395f27d
commit fd21f82aa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 15 deletions

View file

@ -28,6 +28,7 @@
"""
from ctypes import byref, c_char_p, c_int
from enum import IntEnum
from types import NoneType
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import SRSException
@ -57,7 +58,7 @@ class SpatialReference(GDALBase):
EPSG code, a PROJ string, and/or a projection "well known" shorthand
string (one of 'WGS84', 'WGS72', 'NAD27', 'NAD83').
"""
if not isinstance(axis_order, (type(None), AxisOrder)):
if not isinstance(axis_order, (NoneType, AxisOrder)):
raise ValueError(
"SpatialReference.axis_order must be an AxisOrder instance."
)