From ec0ff406311de88f4e2a135d784363424fe602aa Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 19 Jan 2021 08:35:16 +0100 Subject: Fixed #32355 -- Dropped support for Python 3.6 and 3.7 --- django/db/backends/postgresql/base.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'django/db/backends/postgresql') diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 126f30b462..ad8d85da29 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -261,12 +261,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): # For now, it's here so that every use of "threading" is # also async-compatible. try: - if hasattr(asyncio, 'current_task'): - # Python 3.7 and up - current_task = asyncio.current_task() - else: - # Python 3.6 - current_task = asyncio.Task.current_task() + current_task = asyncio.current_task() except RuntimeError: current_task = None # Current task can be none even if the current_task call didn't error -- cgit v1.3