Skip to content

Commit 417fbe2

Browse files
committed
added errors
1 parent b4e23fb commit 417fbe2

File tree

6 files changed

+355
-4
lines changed

6 files changed

+355
-4
lines changed

errors.v

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
module py
2+
3+
pub const (
4+
py_exc_base_exception = &C.PyObject(C.PyExc_BaseException)
5+
py_exc_exception = &C.PyObject(C.PyExc_Exception)
6+
// py_exc_base_exception_group = &C.PyObject(C.PyExc_BaseExceptionGroup)
7+
py_exc_stop_async_iteration = &C.PyObject(C.PyExc_StopAsyncIteration)
8+
py_exc_stop_iteration = &C.PyObject(C.PyExc_StopIteration)
9+
py_exc_generator_exit = &C.PyObject(C.PyExc_GeneratorExit)
10+
py_exc_arithmetic_error = &C.PyObject(C.PyExc_ArithmeticError)
11+
py_exc_lookup_error = &C.PyObject(C.PyExc_LookupError)
12+
py_exc_assertion_error = &C.PyObject(C.PyExc_AssertionError)
13+
py_exc_attribute_error = &C.PyObject(C.PyExc_AttributeError)
14+
py_exc_buffer_error = &C.PyObject(C.PyExc_BufferError)
15+
py_exc_eof_error = &C.PyObject(C.PyExc_EOFError)
16+
py_exc_floating_point_error = &C.PyObject(C.PyExc_FloatingPointError)
17+
py_exc_os_error = &C.PyObject(C.PyExc_OSError)
18+
py_exc_import_error = &C.PyObject(C.PyExc_ImportError)
19+
py_exc_module_not_found_error = &C.PyObject(C.PyExc_ModuleNotFoundError)
20+
py_exc_index_error = &C.PyObject(C.PyExc_IndexError)
21+
py_exc_key_error = &C.PyObject(C.PyExc_KeyError)
22+
py_exc_keyboard_interrupt = &C.PyObject(C.PyExc_KeyboardInterrupt)
23+
py_exc_memory_error = &C.PyObject(C.PyExc_MemoryError)
24+
py_exc_name_error = &C.PyObject(C.PyExc_NameError)
25+
py_exc_overflow_error = &C.PyObject(C.PyExc_OverflowError)
26+
py_exc_runtime_error = &C.PyObject(C.PyExc_RuntimeError)
27+
py_exc_recursion_error = &C.PyObject(C.PyExc_RecursionError)
28+
py_exc_not_implemented_error = &C.PyObject(C.PyExc_NotImplementedError)
29+
py_exc_syntax_error = &C.PyObject(C.PyExc_SyntaxError)
30+
py_exc_indentation_error = &C.PyObject(C.PyExc_IndentationError)
31+
py_exc_tab_error = &C.PyObject(C.PyExc_TabError)
32+
py_exc_reference_error = &C.PyObject(C.PyExc_ReferenceError)
33+
py_exc_system_error = &C.PyObject(C.PyExc_SystemError)
34+
py_exc_system_exit = &C.PyObject(C.PyExc_SystemExit)
35+
py_exc_type_error = &C.PyObject(C.PyExc_TypeError)
36+
py_exc_unbound_local_error = &C.PyObject(C.PyExc_UnboundLocalError)
37+
py_exc_unicode_error = &C.PyObject(C.PyExc_UnicodeError)
38+
py_exc_unicode_encode_error = &C.PyObject(C.PyExc_UnicodeEncodeError)
39+
py_exc_unicode_decode_error = &C.PyObject(C.PyExc_UnicodeDecodeError)
40+
py_exc_unicode_translate_error = &C.PyObject(C.PyExc_UnicodeTranslateError)
41+
py_exc_value_error = &C.PyObject(C.PyExc_ValueError)
42+
py_exc_zero_division_error = &C.PyObject(C.PyExc_ZeroDivisionError)
43+
py_exc_blocking_io_error = &C.PyObject(C.PyExc_BlockingIOError)
44+
py_exc_broken_pipe_error = &C.PyObject(C.PyExc_BrokenPipeError)
45+
py_exc_child_process_error = &C.PyObject(C.PyExc_ChildProcessError)
46+
py_exc_connection_error = &C.PyObject(C.PyExc_ConnectionError)
47+
py_exc_connection_aborted_error = &C.PyObject(C.PyExc_ConnectionAbortedError)
48+
py_exc_connection_refused_error = &C.PyObject(C.PyExc_ConnectionRefusedError)
49+
py_exc_connection_reset_error = &C.PyObject(C.PyExc_ConnectionResetError)
50+
py_exc_file_exists_error = &C.PyObject(C.PyExc_FileExistsError)
51+
py_exc_file_not_found_error = &C.PyObject(C.PyExc_FileNotFoundError)
52+
py_exc_interrupted_error = &C.PyObject(C.PyExc_InterruptedError)
53+
py_exc_is_a_directory_error = &C.PyObject(C.PyExc_IsADirectoryError)
54+
py_exc_not_a_directory_error = &C.PyObject(C.PyExc_NotADirectoryError)
55+
py_exc_permission_error = &C.PyObject(C.PyExc_PermissionError)
56+
py_exc_process_lookup_error = &C.PyObject(C.PyExc_ProcessLookupError)
57+
py_exc_timeout_error = &C.PyObject(C.PyExc_TimeoutError)
58+
py_exc_io_error = &C.PyObject(C.PyExc_IOError)
59+
py_exc_user_warning = &C.PyObject(C.PyExc_UserWarning)
60+
py_exc_deprecation_warning = &C.PyObject(C.PyExc_DeprecationWarning)
61+
py_exc_pending_deprecation_warning = &C.PyObject(C.PyExc_PendingDeprecationWarning)
62+
py_exc_syntax_warning = &C.PyObject(C.PyExc_SyntaxWarning)
63+
py_exc_runtime_warning = &C.PyObject(C.PyExc_RuntimeWarning)
64+
py_exc_future_warning = &C.PyObject(C.PyExc_FutureWarning)
65+
py_exc_import_warning = &C.PyObject(C.PyExc_ImportWarning)
66+
py_exc_unicode_warning = &C.PyObject(C.PyExc_UnicodeWarning)
67+
py_exc_bytes_warning = &C.PyObject(C.PyExc_BytesWarning)
68+
// py_exc_encoding_warning = &C.PyObject(C.PyExc_EncodingWarning)
69+
py_exc_resource_warning = &C.PyObject(C.PyExc_ResourceWarning)
70+
)
71+
72+
pub fn C.PyExceptionClass_Check(&C.PyObject) int
73+
pub fn C.PyExceptionInstance_Check(&C.PyObject) int
74+
pub fn C.PyExceptionInstance_Class(&C.PyObject) &C.PyObject
75+
76+
pub fn C.PyErr_SetNone(&C.PyObject)
77+
pub fn C.PyErr_SetObject(&C.PyObject, &C.PyObject)
78+
pub fn C.PyErr_SetString(&C.PyObject, &char)
79+
pub fn C.PyErr_Occurred() &C.PyObject
80+
pub fn C.PyErr_Clear()
81+
pub fn C.PyErr_Fetch(&&C.PyObject, &&C.PyObject, &&C.PyObject)
82+
pub fn C.PyErr_Restore(&C.PyObject, &C.PyObject, &C.PyObject)
83+
pub fn C.PyErr_GetExcInfo(&&C.PyObject, &&C.PyObject, &&C.PyObject)
84+
pub fn C.PyErr_SetExcInfo(&C.PyObject, &C.PyObject, &C.PyObject)
85+
pub fn C.PyErr_ExceptionMatches(&C.PyObject) int
86+
pub fn C.PyErr_GivenExceptionMatches(&C.PyObject, &C.PyObject) int
87+
pub fn C.PyErr_NormalizeException(&&C.PyObject, &&C.PyObject, &&C.PyObject)
88+
pub fn C.PyException_GetTraceback(&C.PyObject) &C.PyObject
89+
pub fn C.PyException_SetCause(&C.PyObject, &C.PyObject)
90+
pub fn C.PyException_SetContext(&C.PyObject, &C.PyObject)
91+
pub fn C.PyExceptionClass_Name(&C.PyObject) &char
92+
pub fn C.PyErr_BadArgument() int
93+
pub fn C.PyErr_NoMemory() &C.PyObject
94+
pub fn C.PyErr_SetFromErrno(&C.PyObject) &C.PyObject
95+
pub fn C.PyErr_SetFromErrnoWithFilenameObject(&C.PyObject, &C.PyObject) &C.PyObject
96+
pub fn C.PyErr_SetFromErrnoWithFilenameObjects(&C.PyObject, &C.PyObject, &C.PyObject) &C.PyObject
97+
pub fn C.PyErr_SetFromErrnoWithFilename(&C.PyObject, &char) &C.PyObject
98+
pub fn C.PyErr_Format(&C.PyObject, &char, ) &C.PyObject
99+
pub fn C.PyErr_FormatV(&C.PyObject, &char, &C.va_list) &C.PyObject
100+
pub fn C.PyErr_SetImportErrorSubclass(&C.PyObject, &C.PyObject, &C.PyObject, &C.PyObject) &C.PyObject
101+
pub fn C.PyErr_SetImportError(&C.PyObject, &C.PyObject, &C.PyObject) &C.PyObject
102+
pub fn C.PyErr_NewExceptionWithDoc(&char, &char, &C.PyObject, &C.PyObject) &C.PyObject
103+
pub fn C.PyErr_WriteUnraisable(&C.PyObject)
104+
pub fn C.PyErr_SetInterrupt()
105+
pub fn C.PyErr_SetInterruptEx(int) int
106+
pub fn C.PyErr_SyntaxLocation(&char, int)
107+
pub fn C.PyErr_SyntaxLocationEx(&char, int, int)
108+
pub fn C.PyErr_SyntaxLocationObject(&C.PyObject, int, int)
109+
pub fn C.PyErr_ProgramText(&char, int) &C.PyObject
110+
pub fn C.PyUnicodeDecodeError_GetEncoding(&C.PyObject) &C.PyObject
111+
pub fn C.PyUnicodeDecodeError_GetObject(&C.PyObject) &C.PyObject
112+
pub fn C.PyUnicodeTranslateError_GetObject(&C.PyObject) &C.PyObject
113+
pub fn C.PyUnicodeDecodeError_GetStart(&C.PyObject, &C.Py_ssize_t) int
114+
pub fn C.PyUnicodeTranslateError_GetStart(&C.PyObject, &C.Py_ssize_t) int
115+
pub fn C.PyUnicodeDecodeError_SetStart(&C.PyObject, &C.Py_ssize_t) int
116+
pub fn C.PyUnicodeTranslateError_SetStart(&C.PyObject, &C.Py_ssize_t) int
117+
pub fn C.PyUnicodeDecodeError_GetEnd(&C.PyObject, &C.Py_ssize_t) int
118+
pub fn C.PyUnicodeTranslateError_GetEnd(&C.PyObject, &C.Py_ssize_t) int
119+
pub fn C.PyUnicodeDecodeError_SetEnd(&C.PyObject, &C.Py_ssize_t) int
120+
pub fn C.PyUnicodeTranslateError_SetEnd(&C.PyObject, &C.Py_ssize_t) int
121+
pub fn C.PyUnicodeDecodeError_GetReason(&C.PyObject) &C.PyObject
122+
pub fn C.PyUnicodeTranslateError_GetReason(&C.PyObject) &C.PyObject
123+
pub fn C.PyUnicodeDecodeError_SetReason(&C.PyObject, &char) int
124+
pub fn C.PyUnicodeTranslateError_SetReason(&C.PyObject, &char) int
125+
pub fn C.PyOS_snprintf(&char, &C.size_t, &char, ...&&C.PyObject) int
126+
pub fn C.PyOS_vsnprintf(&char, &C.size_t, &char, &C.va_list) int

errors_test.v

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
module py
2+
3+
4+
fn testsuite_begin() {
5+
C.Py_Initialize()
6+
py_redirect_stderr()
7+
}
8+
9+
fn testsuite_end() {
10+
}
11+
12+
fn py_err_occurred() voidptr {
13+
r := C.PyErr_Occurred()
14+
return voidptr(r)
15+
}
16+
17+
fn py_redirect_stderr() {
18+
io := C.PyImport_ImportModule(c'io')
19+
str_io := C.PyObject_GetAttrString(io, c'StringIO')
20+
str_io_i := C.PyObject_CallFunctionObjArgs(str_io, C.NULL)
21+
C.PySys_SetObject(c'stderr', str_io_i)
22+
C.Py_XDECREF(io)
23+
C.Py_XDECREF(str_io)
24+
C.Py_XDECREF(str_io_i)
25+
}
26+
27+
fn py_read_stderr() string {
28+
stderr := C.PySys_GetObject(c'stderr') // borrowed ref
29+
m_getvalue := C.PyUnicode_FromString(c'getvalue')
30+
m_truncate := C.PyUnicode_FromString(c'truncate')
31+
m_seek := C.PyUnicode_FromString(c'seek')
32+
v := C.PyObject_CallMethodObjArgs(stderr, m_getvalue, C.NULL)
33+
s := C.PyUnicode_AsUTF8(v)
34+
r := unsafe{cstring_to_vstring(s)}
35+
z := C.PyLong_FromLong(0)
36+
C.PyObject_CallMethodObjArgs(stderr, m_truncate, z, C.NULL)
37+
C.PyObject_CallMethodObjArgs(stderr, m_seek, z, C.NULL)
38+
return r.trim_space()
39+
}
40+
41+
fn test_err_set_string() {
42+
m := 'test message'
43+
C.PyErr_SetString(C.PyExc_BaseException, m.str)
44+
assert py_err_occurred() != C.NULL
45+
C.PyErr_Print()
46+
e := py_read_stderr()
47+
assert 'BaseException: ${m}' == e
48+
assert py_err_occurred() == C.NULL
49+
}
50+
51+
fn test_err_set_object() {
52+
m := 'test message'
53+
msg := C.PyUnicode_FromString(m.str)
54+
C.PyErr_SetObject(C.PyExc_BaseException, msg)
55+
assert py_err_occurred() != C.NULL
56+
C.PyErr_Print()
57+
e := py_read_stderr()
58+
assert 'BaseException: ${m}' == e
59+
C.Py_XDECREF(msg)
60+
assert py_err_occurred() == C.NULL
61+
}
62+
63+
fn test_err_set_none() {
64+
C.PyErr_SetNone(C.PyExc_BaseException)
65+
assert py_err_occurred() != C.NULL
66+
C.PyErr_Clear()
67+
assert py_err_occurred() == C.NULL
68+
}
69+
70+
fn test_err_print_ex() {
71+
m := 'test message'
72+
msg := C.PyUnicode_FromString(m.str)
73+
C.PyErr_SetObject(C.PyExc_BaseException, msg)
74+
assert py_err_occurred() != C.NULL
75+
C.PyErr_PrintEx(0)
76+
e := py_read_stderr()
77+
assert 'BaseException: ${m}' == e
78+
assert py_err_occurred() == C.NULL
79+
C.Py_XDECREF(msg)
80+
}
81+
82+
fn test_err_print_ex_with_set_sys_last_vars() {
83+
message := 'test message'
84+
msg := C.PyUnicode_FromString(message.str)
85+
defer {
86+
C.Py_XDECREF(msg)
87+
}
88+
C.PyErr_SetObject(C.PyExc_BaseException, msg)
89+
assert py_err_occurred() != C.NULL
90+
C.PyErr_PrintEx(1)
91+
92+
last_val := C.PySys_GetObject(c'last_value')
93+
last_val_t := C.PyExceptionInstance_Class(last_val)
94+
assert last_val_t.ptr() == py_exc_base_exception.ptr()
95+
96+
last_type := C.PySys_GetObject(c'last_type')
97+
assert last_type.ptr() == py_exc_base_exception.ptr()
98+
99+
last_tb := C.PySys_GetObject(c'last_traceback')
100+
assert last_tb.ptr() != C.NULL
101+
102+
last_t_name := C.PyObject_GetAttrString(last_val_t, c'__name__')
103+
t_name := C.PyUnicode_AsUTF8(last_t_name)
104+
exc_name := unsafe{cstring_to_vstring(t_name)}
105+
106+
e := py_read_stderr()
107+
assert '$exc_name: $message' == e
108+
109+
assert py_err_occurred() == C.NULL
110+
}
111+
112+
fn test_err_syntax_location() {
113+
C.PyErr_SetNone(C.PyExc_SyntaxError)
114+
C.PyErr_SyntaxLocation(c'test.py', 0)
115+
assert py_err_occurred() != C.NULL
116+
C.PyErr_Clear()
117+
assert py_err_occurred() == C.NULL
118+
}
119+
120+
fn test_err_syntax_location_ex() {
121+
C.PyErr_SetNone(C.PyExc_SyntaxError)
122+
C.PyErr_SyntaxLocationEx(c'test.py', 0, 0)
123+
assert py_err_occurred() != C.NULL
124+
C.PyErr_Clear()
125+
assert py_err_occurred() == C.NULL
126+
}
127+
128+
fn test_err_syntax_location_obj() {
129+
C.PyErr_SetNone(C.PyExc_SyntaxError)
130+
filename := C.PyUnicode_FromString(c'test.py')
131+
defer { C.Py_DECREF(filename) }
132+
C.PyErr_SyntaxLocationObject(filename, 0, 0)
133+
assert py_err_occurred() != C.NULL
134+
C.PyErr_Clear()
135+
assert py_err_occurred() == C.NULL
136+
}
137+
138+
fn test_err_ex_matches() {
139+
C.PyErr_SetNone(C.PyExc_KeyError)
140+
assert C.PyErr_ExceptionMatches(C.PyExc_KeyError) == 1
141+
assert py_err_occurred() != C.NULL
142+
C.PyErr_Clear()
143+
assert py_err_occurred() == C.NULL
144+
}
145+
146+
fn test_err_given_ex_matches() {
147+
assert C.PyErr_GivenExceptionMatches(C.PyExc_KeyError, C.PyExc_KeyError) == 1
148+
}
149+
150+
fn test_err_fetch_restore() {
151+
C.PyErr_SetNone(C.PyExc_KeyError)
152+
mut exc := py_obj()
153+
mut val := py_obj()
154+
mut tb := py_obj()
155+
C.PyErr_Fetch(&exc, &val, &tb)
156+
assert py_err_occurred() == C.NULL
157+
assert exc.ptr() != C.NULL
158+
assert val.ptr() == C.NULL
159+
assert tb.ptr() == C.NULL
160+
assert C.PyErr_GivenExceptionMatches(exc, C.PyExc_KeyError) == 1
161+
C.PyErr_Restore(exc, val, tb)
162+
assert py_err_occurred() != C.NULL
163+
C.PyErr_Clear()
164+
assert py_err_occurred() == C.NULL
165+
}
166+
167+
fn test_err_normalize_restore() {
168+
C.PyErr_SetNone(C.PyExc_KeyError)
169+
mut exc := py_obj()
170+
mut val := py_obj()
171+
mut tb := py_obj()
172+
C.PyErr_Fetch(&exc, &val, &tb)
173+
C.PyErr_NormalizeException(&exc, &val, &tb)
174+
assert C.PyErr_GivenExceptionMatches(exc, C.PyExc_KeyError) == 1
175+
assert C.PyObject_IsInstance(val, exc) == 1
176+
assert tb.ptr() == C.NULL
177+
C.PyErr_Restore(exc, val, tb)
178+
assert py_err_occurred() != C.NULL
179+
C.PyErr_Clear()
180+
assert py_err_occurred() == C.NULL
181+
}
182+
183+
fn test_err_get_set_exc_info() {
184+
C.PyErr_SetNone(C.PyExc_KeyError)
185+
mut exc := py_obj()
186+
mut val := py_obj()
187+
mut tb := py_obj()
188+
C.PyErr_GetExcInfo(&exc, &val, &tb)
189+
assert C.PyErr_GivenExceptionMatches(exc, C.Py_None) == 1
190+
assert val.ptr() == C.NULL
191+
assert tb.ptr() == C.NULL
192+
C.PyErr_SetExcInfo(exc, val, tb)
193+
C.PyErr_Clear()
194+
assert py_err_occurred() == C.NULL
195+
}

errors_windows.c.v

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module py
2+
3+
pub const (
4+
py_exc_windows_error = &C.PyObject(C.PyExc_WindowsError)
5+
)
6+
7+
pub fn C.PyErr_SetFromWindowsErrWithFilename(int, &char) &C.PyObject
8+
pub fn C.PyErr_SetFromWindowsErr(int) &C.PyObject
9+
pub fn C.PyErr_SetExcFromWindowsErrWithFilenameObject(&C.PyObject, int, &C.PyObject) &C.PyObject
10+
pub fn C.PyErr_SetExcFromWindowsErrWithFilenameObjects(&C.PyObject, int, &C.PyObject, &C.PyObject) &C.PyObject
11+
pub fn C.PyErr_SetExcFromWindowsErrWithFilename(&C.PyObject, int, &char) &C.PyObject
12+
pub fn C.PyErr_SetExcFromWindowsErr(&C.PyObject, int) &C.PyObject

py.v

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ pub struct C.PyCFunction { }
1313
[typedef]
1414
pub struct C.Py_ssize_t { }
1515

16-
pub struct C.PyObject {}
16+
pub struct C.PyTypeObject { }
17+
18+
pub struct C.PyObject { }
1719

1820
[inline]
19-
pub fn (po &C.PyObject) ptr() voidptr {
20-
return voidptr(po)
21+
pub fn (o &C.PyObject) ptr() voidptr {
22+
return voidptr(o)
23+
}
24+
25+
fn (o &C.PyObject) str() string {
26+
str_p := C.PyObject_Str(o)
27+
str_c := C.PyUnicode_AsUTF8(str_p)
28+
return unsafe{cstring_to_vstring(str_c).trim_space()}
2129
}
2230

2331
pub type PyFunc = fn(&C.PyObject, &C.PyObject) &C.PyObject
@@ -56,8 +64,15 @@ pub fn C.Py_FinalizeEx() int
5664

5765
pub fn C.PyMem_RawFree(voidptr)
5866

59-
// call protocol
67+
pub fn C.PyObject_Str(&C.PyObject) &C.PyObject
6068
pub fn C.PyObject_CallObject(&C.PyObject, &C.PyObject) &C.PyObject
69+
pub fn C.PyObject_CallFunctionObjArgs(&C.PyObject, ...&C.PyObject) &C.PyObject
70+
pub fn C.PyObject_CallMethodObjArgs(&C.PyObject, &C.PyObject, ...&C.PyObject) &C.PyObject
71+
pub fn C.PyObject_CallMethod(&C.PyObject, &char, &char, ...&C.PyObject) &C.PyObject
72+
pub fn C.PyObject_IsInstance(&C.PyObject, &C.PyObject) int
73+
74+
pub fn C.PySys_SetObject(&char, &C.PyObject) int
75+
pub fn C.PySys_GetObject(&char) &C.PyObject
6176

6277
// macros
6378
pub fn C.Py_INCREF(&C.PyObject)
@@ -76,6 +91,7 @@ pub fn C.PyUnicode_FromString(&char) &C.PyObject
7691
pub fn C.PyUnicode_AsUTF8(&C.PyObject) &char
7792
pub fn C.PyUnicode_DecodeLocaleAndSize(&char, &C.Py_ssize_t, &char) &C.PyObject
7893
pub fn C.PyUnicode_DecodeFSDefault(&char) &C.PyObject
94+
pub fn C.PyUnicode_AsEncodedString(&C.PyObject, &char, &char) &C.PyObject
7995
pub fn C.PyImport_ImportModule(&char) &C.PyObject
8096
pub fn C.PyImport_Import(&C.PyObject) &C.PyObject
8197
pub fn C.PySys_SetPath(&u16)

test_all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export CFLAGS="$(pkg-config python3 --cflags-only-I)" # -DPy_LIMITED_API=3
22
export LDFLAGS=$(pkg-config python3-embed --libs)
3+
#export VJOBS=1
34
v -cc gcc test .

test_all_limited.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export CFLAGS="$(pkg-config python3 --cflags-only-I) -DPy_LIMITED_API=0x30907f0"
22
export LDFLAGS=$(pkg-config python3-embed --libs)
3+
# export VJOBS=1
34
v -d py_limited_api -cc gcc test .

0 commit comments

Comments
 (0)