File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change 31
31
else :
32
32
from typing_extensions import deprecated # noqa
33
33
34
- if sys .version_info >= (3 , 11 ):
35
- import tomllib # noqa
36
- else :
37
- tomllib = None
38
-
39
34
40
35
def missing_dependency (
41
36
package : str , display_name : str | None = None
@@ -245,6 +240,20 @@ class BehaviorChangeWarning(UserWarning):
245
240
except ImportError :
246
241
HAS_DASK = False
247
242
243
+ try :
244
+ import tomli_w # noqa: F401
245
+
246
+ HAS_TOMLLI_W = True
247
+ except ImportError :
248
+ HAS_TOMLLI_W = False
249
+
250
+ if sys .version_info >= (3 , 11 ):
251
+ import tomllib # noqa
252
+
253
+ HAS_TOMLLIB = True
254
+ else :
255
+ HAS_TOMLLIB = False
256
+
248
257
249
258
##############################
250
259
# Imports are handled here
@@ -253,6 +262,17 @@ class BehaviorChangeWarning(UserWarning):
253
262
# in mypy configuration.
254
263
##############################
255
264
265
+ if HAS_TOMLLIB :
266
+ import tomllib # noqa: F401
267
+ else :
268
+ tomllib = None
269
+
270
+ if HAS_TOMLLI_W :
271
+ import tomli_w # noqa: F401
272
+ else :
273
+ tomllib_w = None
274
+
275
+
256
276
if HAS_BABEL :
257
277
from babel import Locale
258
278
from babel import units as babel_units
You can’t perform that action at this time.
0 commit comments