Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions asgiref/current_thread_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,5 @@ def _submit(
# Return the future
return f

# Python 3.9+ has a new signature for submit with a "/" after `fn`, to enforce
# it to be a positional argument. If we ignore[override] mypy on 3.9+ will be
# happy but 3.8 will say that the ignore comment is unused, even when
# defining them differently based on sys.version_info.
# We should be able to remove this when we drop support for 3.8.
if not TYPE_CHECKING:

def submit(self, fn, *args, **kwargs):
return self._submit(fn, *args, **kwargs)
def submit(self, fn, *args, **kwargs):
return self._submit(fn, *args, **kwargs)
6 changes: 1 addition & 5 deletions asgiref/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ def __init__(self) -> None:
def __getattr__(self, key: str) -> Any:
try:
var = self._data[key]
except KeyError:
raise AttributeError(f"{self!r} object has no attribute {key!r}")

try:
return var.get()
except LookupError:
except (KeyError, LookupError):
raise AttributeError(f"{self!r} object has no attribute {key!r}")

def __setattr__(self, key: str, value: Any) -> None:
Expand Down