Skip to content

Commit 7f03445

Browse files
authored
Doc: fix import of asdl.py when called from outside Doc/. (GH-21529)
1 parent 7cf1cb3 commit 7f03445

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/tools/extensions/asdl_highlight.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import os
22
import sys
3-
sys.path.append(os.path.abspath("../Parser/"))
3+
from pathlib import Path
4+
5+
CPYTHON_ROOT = Path(__file__).resolve().parent.parent.parent.parent
6+
sys.path.append(str(CPYTHON_ROOT / "Parser"))
47

58
from pygments.lexer import RegexLexer, bygroups, include, words
69
from pygments.token import (Comment, Generic, Keyword, Name, Operator,

0 commit comments

Comments
 (0)