Skip to content

Commit 5caec1e

Browse files
Merge pull request #2574 from pallets-eco/fix/packaging-wtforms
Don't use packaging for wtforms version check
2 parents aad1b87 + 4d20a8d commit 5caec1e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77
Fixes:
88

99
* Jinja templates can now be loaded in StrictUndefined mode.
10+
* Remove an implicit dependency on `packaging`
1011

1112
2.0.0a2
1213
-------

flask_admin/_compat.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@ def _iter_choices_wtforms_compat(val, label, selected):
4646
4747
https://wtforms.readthedocs.io/en/3.2.x/changes/#version-3-2-0
4848
"""
49-
from packaging.version import Version
5049
import wtforms
5150

52-
wtforms_version = Version(wtforms.__version__)
51+
wtforms_version = tuple(int(part) for part in wtforms.__version__.split(".")[:2])
5352

54-
if wtforms_version >= Version("3.2.0"):
53+
if wtforms_version >= (3, 2):
5554
return val, label, selected, {}
5655

5756
return val, label, selected

0 commit comments

Comments
 (0)