Skip to content

Commit 30b6d87

Browse files
authored
Replace deprecated distutils with packaging
Silence the deprecation warnings by using `packaging`
1 parent 3f1d590 commit 30b6d87

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas_datareader/compat/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from distutils.version import LooseVersion
2-
from functools import reduce
1+
from packaging import version
32
from io import StringIO
43
from urllib.error import HTTPError
54

@@ -10,9 +9,9 @@
109

1110
PANDAS_VERSION = LooseVersion(pd.__version__)
1211

13-
PANDAS_0210 = PANDAS_VERSION >= LooseVersion("0.21.0")
14-
PANDAS_0220 = PANDAS_VERSION >= LooseVersion("0.22.0")
15-
PANDAS_0230 = PANDAS_VERSION >= LooseVersion("0.23.0")
12+
PANDAS_0210 = PANDAS_VERSION >= version.parse("0.21.0")
13+
PANDAS_0220 = PANDAS_VERSION >= version.parse("0.22.0")
14+
PANDAS_0230 = PANDAS_VERSION >= version.parse("0.23.0")
1615

1716
__all__ = [
1817
"HTTPError",

0 commit comments

Comments
 (0)