Skip to content

Commit 285390a

Browse files
JulienPalardarun-mani-j
authored andcommitted
Doc: fix import of asdl.py when called from outside Doc/. (pythonGH-21529)
1 parent cd6fdd9 commit 285390a

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)