diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-01-30 15:53:27 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-01-31 08:59:54 -0500 |
| commit | 4a52533329a03207c1c4592a13fbb12b9ec5ef9e (patch) | |
| tree | d45724230dc3a299b1563418e2713cfc81450604 /django/core | |
| parent | 93dfb16e96797583a6f45eeb918e78c7f2817318 (diff) | |
Refs #34118 -- Removed asgiref coroutine detection shims.
As Python 3.12 is now the floor, we can drop the shims and
use the `inspect` module.
Diffstat (limited to 'django/core')
| -rw-r--r-- | django/core/handlers/base.py | 3 | ||||
| -rw-r--r-- | django/core/handlers/exception.py | 3 | ||||
| -rw-r--r-- | django/core/paginator.py | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py index af3e0c3a50..d65a5edcb6 100644 --- a/django/core/handlers/base.py +++ b/django/core/handlers/base.py @@ -1,8 +1,9 @@ import asyncio import logging import types +from inspect import iscoroutinefunction -from asgiref.sync import async_to_sync, iscoroutinefunction, sync_to_async +from asgiref.sync import async_to_sync, sync_to_async from django.conf import settings from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed diff --git a/django/core/handlers/exception.py b/django/core/handlers/exception.py index 1243734705..4adc9d7c6a 100644 --- a/django/core/handlers/exception.py +++ b/django/core/handlers/exception.py @@ -1,8 +1,9 @@ import logging import sys from functools import wraps +from inspect import iscoroutinefunction -from asgiref.sync import iscoroutinefunction, sync_to_async +from asgiref.sync import sync_to_async from django.conf import settings from django.core import signals diff --git a/django/core/paginator.py b/django/core/paginator.py index aabc2f8532..d1842d6adb 100644 --- a/django/core/paginator.py +++ b/django/core/paginator.py @@ -3,7 +3,7 @@ import inspect import warnings from math import ceil -from asgiref.sync import iscoroutinefunction, sync_to_async +from asgiref.sync import sync_to_async from django.utils.deprecation import RemovedInDjango70Warning from django.utils.functional import cached_property @@ -266,7 +266,7 @@ class AsyncPaginator(BasePaginator): return self._cache_acount c = getattr(self.object_list, "acount", None) if ( - iscoroutinefunction(c) + inspect.iscoroutinefunction(c) and not inspect.isbuiltin(c) and method_has_no_args(c) ): |
