mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #34302 -- Fixed SpatialReference.auth_name()/auth_code() when target is None.
force_bytes() turns None into the byte string b"None". Since ctypes.c_char_p() also accepts None, we can bypass force_bytes() if target is None.
This commit is contained in:
committed by
Mariusz Felisiak
parent
52b054824e
commit
d77762de03
@@ -159,11 +159,15 @@ class SpatialReference(GDALBase):
|
||||
|
||||
def auth_name(self, target):
|
||||
"Return the authority name for the given string target node."
|
||||
return capi.get_auth_name(self.ptr, force_bytes(target))
|
||||
return capi.get_auth_name(
|
||||
self.ptr, target if target is None else force_bytes(target)
|
||||
)
|
||||
|
||||
def auth_code(self, target):
|
||||
"Return the authority code for the given string target node."
|
||||
return capi.get_auth_code(self.ptr, force_bytes(target))
|
||||
return capi.get_auth_code(
|
||||
self.ptr, target if target is None else force_bytes(target)
|
||||
)
|
||||
|
||||
def clone(self):
|
||||
"Return a clone of this SpatialReference object."
|
||||
|
||||
Reference in New Issue
Block a user