PHP 8.2.30
Preview: fail_cpp_exception.py Size: 985 B
/opt/hc_python/lib64/python3.12/site-packages/greenlet/tests/fail_cpp_exception.py

# -*- coding: utf-8 -*-
"""
Helper for testing a C++ exception throw aborts the process.

Takes one argument, the name of the function in :mod:`_test_extension_cpp` to call.
"""
import sys
import greenlet
from greenlet.tests import _test_extension_cpp
print('fail_cpp_exception is running')

def run_unhandled_exception_in_greenlet_aborts():
    def _():
        _test_extension_cpp.test_exception_switch_and_do_in_g2(
            _test_extension_cpp.test_exception_throw_nonstd
        )
    g1 = greenlet.greenlet(_)
    g1.switch()


func_name = sys.argv[1]
try:
    func = getattr(_test_extension_cpp, func_name)
except AttributeError:
    if func_name == run_unhandled_exception_in_greenlet_aborts.__name__:
        func = run_unhandled_exception_in_greenlet_aborts
    elif func_name == 'run_as_greenlet_target':
        g = greenlet.greenlet(_test_extension_cpp.test_exception_throw_std)
        func = g.switch
    else:
        raise
print('raising', func, flush=True)
func()

Directory Contents

Dirs: 1 × Files: 27

Name Size Perms Modified Actions
- drwxr-xr-x 2025-12-03 08:02:54
Edit Download
1.23 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
985 B lrw-r--r-- 2025-12-03 08:02:54
Edit Download
1.92 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
524 B lrw-r--r-- 2025-12-03 08:02:54
Edit Download
956 B lrw-r--r-- 2025-12-03 08:02:54
Edit Download
1.25 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
817 B lrw-r--r-- 2025-12-03 08:02:54
Edit Download
12.32 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
10.29 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
2.67 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
3.74 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
2.85 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
1.21 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
3.63 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
46.87 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
7.76 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
17.65 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
446 B lrw-r--r-- 2025-12-03 08:02:54
Edit Download
3.63 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
8.39 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
1.31 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
883 B lrw-r--r-- 2025-12-03 08:02:54
Edit Download
5.64 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
16.85 KB lrwxr-xr-x 2025-12-03 08:02:54
Edit Download
6.41 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download
57.02 KB lrwxr-xr-x 2025-12-03 08:02:54
Edit Download
9.51 KB lrw-r--r-- 2025-12-03 08:02:54
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).