[Git][ghc/ghc][ghc-9.10] docs: Don't use str.isascii

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Fri Apr 26 18:39:25 UTC 2024



Ben Gamari pushed to branch ghc-9.10 at Glasgow Haskell Compiler / GHC


Commits:
57b07e02 by Ben Gamari at 2024-04-26T09:26:51-04:00
docs: Don't use str.isascii

`str.isascii` is only supported in Python 3.7 and later.

- - - - -


1 changed file:

- docs/users_guide/conf.py


Changes:

=====================================
docs/users_guide/conf.py
=====================================
@@ -202,6 +202,10 @@ def parse_flag(env, sig, signode):
     # Reference name left unchanged
     return sig
 
+def isascii(c):
+    """ N.B. str.isascii isn't available until Python 3.7 """
+    return ord(c) < 128
+
 def haddock_role(lib):
     """
     For instance,
@@ -241,7 +245,7 @@ def haddock_role(lib):
             # Escape any symbols in the identifier;
             # see also Haddock.Utils.makeAnchorId
             def escapeChar(c):
-                if (c in ':_.') or (c.isascii() and c.isalnum()):
+                if (c in ':_.') or (isascii(c) and c.isalnum()):
                     return c
                 return '-%d-' % ord(c)
             thing = ''.join(escapeChar(c) for c in thing)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57b07e0266712f9bb71fda508d2bdb93b19f70da

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57b07e0266712f9bb71fda508d2bdb93b19f70da
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/20240426/065a28a1/attachment-0001.html>


More information about the ghc-commits mailing list