We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2202af8 commit a21564bCopy full SHA for a21564b
newsfragments/2135.bugfix.rst
@@ -0,0 +1 @@
1
+Allow `trio` to be a `types.ModuleType` and still have deprecated attributes.
src/trio/_tests/module_with_deprecations.py
@@ -4,15 +4,15 @@
4
# attributes in between calling enable_attribute_deprecations and defining
5
# __deprecated_attributes__:
6
import sys
7
-import typing
+from typing import TYPE_CHECKING
8
9
from .. import _deprecate
10
11
this_mod = sys.modules[__name__]
12
assert this_mod.regular == "hi"
13
assert not hasattr(this_mod, "dep1")
14
15
-if not typing.TYPE_CHECKING:
+if not TYPE_CHECKING:
16
__getattr__ = _deprecate.getattr_for_deprecated_attributes(
17
__name__,
18
{
0 commit comments