mirror of
https://github.com/django/django.git
synced 2025-06-04 02:59:13 +00:00
[5.1.x] Fixed warnings per flake8 7.2.0.
https://github.com/PyCQA/flake8/releases/tag/7.2.0 Backport of 281910ff8e9ae98fa78ee5d26ae3f0b713ccf418 from main.
This commit is contained in:
parent
3215e2a232
commit
0aa0224107
@ -37,8 +37,6 @@ def get_srid_info(srid, connection):
|
|||||||
"""
|
"""
|
||||||
from django.contrib.gis.gdal import SpatialReference
|
from django.contrib.gis.gdal import SpatialReference
|
||||||
|
|
||||||
global _srid_cache
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# The SpatialRefSys model for the spatial backend.
|
# The SpatialRefSys model for the spatial backend.
|
||||||
SpatialRefSys = connection.ops.spatial_ref_sys()
|
SpatialRefSys = connection.ops.spatial_ref_sys()
|
||||||
|
@ -220,7 +220,6 @@ class BaseDatabaseWrapper:
|
|||||||
|
|
||||||
def init_connection_state(self):
|
def init_connection_state(self):
|
||||||
"""Initialize the database connection settings."""
|
"""Initialize the database connection settings."""
|
||||||
global RAN_DB_VERSION_CHECK
|
|
||||||
if self.alias not in RAN_DB_VERSION_CHECK:
|
if self.alias not in RAN_DB_VERSION_CHECK:
|
||||||
self.check_database_version_supported()
|
self.check_database_version_supported()
|
||||||
RAN_DB_VERSION_CHECK.add(self.alias)
|
RAN_DB_VERSION_CHECK.add(self.alias)
|
||||||
|
@ -82,7 +82,6 @@ def check_errors(fn):
|
|||||||
|
|
||||||
|
|
||||||
def raise_last_exception():
|
def raise_last_exception():
|
||||||
global _exception
|
|
||||||
if _exception is not None:
|
if _exception is not None:
|
||||||
raise _exception[1]
|
raise _exception[1]
|
||||||
|
|
||||||
|
@ -289,7 +289,6 @@ def translation(language):
|
|||||||
"""
|
"""
|
||||||
Return a translation object in the default 'django' domain.
|
Return a translation object in the default 'django' domain.
|
||||||
"""
|
"""
|
||||||
global _translations
|
|
||||||
if language not in _translations:
|
if language not in _translations:
|
||||||
_translations[language] = DjangoTranslation(language)
|
_translations[language] = DjangoTranslation(language)
|
||||||
return _translations[language]
|
return _translations[language]
|
||||||
|
@ -485,7 +485,7 @@ class ASGITest(SimpleTestCase):
|
|||||||
|
|
||||||
# A view that will listen for the cancelled error.
|
# A view that will listen for the cancelled error.
|
||||||
async def view(request):
|
async def view(request):
|
||||||
nonlocal view_started, view_did_cancel
|
nonlocal view_did_cancel
|
||||||
view_started.set()
|
view_started.set()
|
||||||
try:
|
try:
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user