/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python/catches_strings_runme.py
21 строка
650 B
William S Fulton
std::string throws typemaps
19 сен 2022, 11:09
19 сен 2022, 11:09
ed333b6
Код
Авторство
О чём код?
from catches_strings import * exception_thrown = False try: StringsThrower.charstring() except RuntimeError as e: if "charstring message" not in str(e): raise RuntimeError("incorrect exception message:" + str(e)) exception_thrown = True if not exception_thrown: raise RuntimeError("Should have thrown an exception") exception_thrown = False try: StringsThrower.stdstring() except RuntimeError as e: if "stdstring message" not in str(e): raise RuntimeError("incorrect exception message:" + str(e)) exception_thrown = True if not exception_thrown: raise RuntimeError("Should have thrown an exception")