1
0
mirror of https://github.com/django/django.git synced 2025-04-06 22:46:41 +00:00

Fixed warnings per flake8 7.2.0.

https://github.com/PyCQA/flake8/releases/tag/7.2.0
This commit is contained in:
Mariusz Felisiak 2025-03-30 17:54:15 +02:00 committed by GitHub
parent c1a4fccf53
commit 281910ff8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1 additions and 6 deletions

View File

@ -37,8 +37,6 @@ def get_srid_info(srid, connection):
"""
from django.contrib.gis.gdal import SpatialReference
global _srid_cache
try:
# The SpatialRefSys model for the spatial backend.
SpatialRefSys = connection.ops.spatial_ref_sys()

View File

@ -221,7 +221,6 @@ class BaseDatabaseWrapper:
def init_connection_state(self):
"""Initialize the database connection settings."""
global RAN_DB_VERSION_CHECK
if self.alias not in RAN_DB_VERSION_CHECK:
self.check_database_version_supported()
RAN_DB_VERSION_CHECK.add(self.alias)

View File

@ -82,7 +82,6 @@ def check_errors(fn):
def raise_last_exception():
global _exception
if _exception is not None:
raise _exception[1]

View File

@ -287,7 +287,6 @@ def translation(language):
"""
Return a translation object in the default 'django' domain.
"""
global _translations
if language not in _translations:
_translations[language] = DjangoTranslation(language)
return _translations[language]

View File

@ -487,7 +487,7 @@ class ASGITest(SimpleTestCase):
# A view that will listen for the cancelled error.
async def view(request):
nonlocal view_started, view_did_cancel
nonlocal view_did_cancel
view_started.set()
try:
await asyncio.sleep(0.1)