Skip to content

Commit

Permalink
Fix re.ASCII usage on Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Nov 7, 2020
1 parent d13a34c commit b5965a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packaging/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import sysconfig
import warnings

from ._compat import PY2
from ._typing import TYPE_CHECKING, cast

if TYPE_CHECKING: # pragma: no cover
Expand Down Expand Up @@ -800,7 +801,10 @@ def _get_host_platform():
return cast(str, aix_platform())
elif osname[:6] == "cygwin":
osname = "cygwin"
rel_re = re.compile(r"[\d.]+", re.ASCII)
if PY2: # Python 2 does not have re.ASCII.
rel_re = re.compile(r"[\d.]+")
else:
rel_re = re.compile(r"[\d.]+", re.ASCII)
m = rel_re.match(release)
if m:
release = m.group()
Expand Down

0 comments on commit b5965a0

Please sign in to comment.