[Git][ghc/ghc][wip/backports-9.8] users_guide: Restore compatibility with pre-packaging Python
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Wed Aug 9 05:37:27 UTC 2023
Ben Gamari pushed to branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC
Commits:
e9d6f1d2 by Ben Gamari at 2023-08-09T01:37:21-04:00
users_guide: Restore compatibility with pre-packaging Python
The `packaging` package is not available in Ubuntu 18.04 or Debian 9.
Fall back to distutils in this case to avoid incurring an extra
dependency.
- - - - -
1 changed file:
- docs/users_guide/flags.py
Changes:
=====================================
docs/users_guide/flags.py
=====================================
@@ -50,7 +50,12 @@ import sphinx
from sphinx import addnodes
from sphinx.domains.std import GenericObject
from sphinx.errors import SphinxError
-from packaging.version import parse
+try:
+ from packaging.version import parse as parse_version
+except ImportError as e:
+ # N.B. `packaging` is not available in Ubuntu 18.04 or Debian 9
+ from distutils import LooseVersion as parse_version
+
from utils import build_table_from_list
import os.path
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e9d6f1d294ae9a92b9469beacd3dda129bb8ee71
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e9d6f1d294ae9a92b9469beacd3dda129bb8ee71
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230809/0afe51af/attachment-0001.html>
More information about the ghc-commits
mailing list