]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Doc: fix import of asdl.py when called from outside Doc/. (GH-21529)
authorJulien Palard <julien@palard.fr>
Mon, 20 Jul 2020 07:48:40 +0000 (09:48 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2020 07:48:40 +0000 (09:48 +0200)
Doc/tools/extensions/asdl_highlight.py

index 7d2ef011c1b76678b4eb82d665f96c712089e357..b1989e53957072fc9fec4ba92731729f567839e6 100644 (file)
@@ -1,6 +1,9 @@
 import os
 import sys
-sys.path.append(os.path.abspath("../Parser/"))
+from pathlib import Path
+
+CPYTHON_ROOT = Path(__file__).resolve().parent.parent.parent.parent
+sys.path.append(str(CPYTHON_ROOT / "Parser"))
 
 from pygments.lexer import RegexLexer, bygroups, include, words
 from pygments.token import (Comment, Generic, Keyword, Name, Operator,