Skip to content

Commit a21564b

Browse files
committed
Add a newsfragment
1 parent 2202af8 commit a21564b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

newsfragments/2135.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow `trio` to be a `types.ModuleType` and still have deprecated attributes.

src/trio/_tests/module_with_deprecations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
# attributes in between calling enable_attribute_deprecations and defining
55
# __deprecated_attributes__:
66
import sys
7-
import typing
7+
from typing import TYPE_CHECKING
88

99
from .. import _deprecate
1010

1111
this_mod = sys.modules[__name__]
1212
assert this_mod.regular == "hi"
1313
assert not hasattr(this_mod, "dep1")
1414

15-
if not typing.TYPE_CHECKING:
15+
if not TYPE_CHECKING:
1616
__getattr__ = _deprecate.getattr_for_deprecated_attributes(
1717
__name__,
1818
{

0 commit comments

Comments
 (0)