forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpython.py
More file actions
27 lines (18 loc) · 726 Bytes
/
cpython.py
File metadata and controls
27 lines (18 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import pathlib
import sys
try:
CPYTHON_ROOT = pathlib.Path(os.environ["CPYTHON_ROOT"]).expanduser().resolve()
except KeyError:
raise ValueError("Missing environment variable 'CPYTHON_ROOT'")
CPYTHON_TOOLS_LIB = CPYTHON_ROOT / "Tools" / "cases_generator"
if (path := CPYTHON_TOOLS_LIB.as_posix()) not in sys.path:
sys.path.append(path)
from analyzer import SKIP_PROPERTIES, Analysis, Family, Properties, analyze_files
from stack import get_stack_effect
def get_analysis() -> Analysis:
from generators_common import DEFAULT_INPUT
analysis = analyze_files([DEFAULT_INPUT])
# Our speration is done at the enum definition
analysis.instructions |= analysis.pseudos
return analysis