Skip to content

Commit b3f0a0c

Browse files
committed
replaced distutils with packaging
1 parent 955637c commit b3f0a0c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"Topic :: Software Development :: Libraries :: Python Modules"
1111
],
1212
description="CS50 library for Python",
13-
install_requires=["Flask>=1.0", "SQLAlchemy==1.4.46", "sqlparse", "termcolor", "wheel"],
13+
install_requires=["Flask>=1.0", "packaging", "SQLAlchemy==1.4.46", "sqlparse", "termcolor", "wheel"],
1414
keywords="cs50",
1515
license="GPLv3",
1616
long_description_content_type="text/markdown",
1717
name="cs50",
1818
package_dir={"": "src"},
1919
packages=["cs50"],
2020
url="https://github.com/cs50/python-cs50",
21-
version="9.2.6"
21+
version="9.2.7"
2222
)

src/cs50/cs50.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import re
77
import sys
88

9-
from distutils.sysconfig import get_python_lib
109
from os.path import abspath, join
1110
from termcolor import colored
1211
from traceback import format_exception

src/cs50/flask.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ def _wrap_flask(f):
66
if f is None:
77
return
88

9-
from distutils.version import StrictVersion
9+
from packaging.version import Version, InvalidVersion
1010
from .cs50 import _formatException
1111

12-
if f.__version__ < StrictVersion("1.0"):
12+
try:
13+
if Version(f.__version__) < Version("1.0"):
14+
return
15+
except InvalidVersion:
1316
return
1417

1518
if os.getenv("CS50_IDE_TYPE") == "online":

0 commit comments

Comments
 (0)