Commit 995da2b5 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline

Apply same SIP wrapping code for Exception on submodules

parent 049aa2d8
......@@ -27,8 +27,23 @@ import shutil
logger = logging.getLogger(__file__)
raise_exc = []
def checksipexc(ifname, inplace=False):
global raise_exc
if not raise_exc:
bfile = open('../../../common/sip/Exceptions.sip')
in_raise_code = False
for l in bfile.readlines():
l = l.strip()
if l == '%RaiseCode':
in_raise_code = True
elif l == '%End':
in_raise_code = False
elif in_raise_code:
raise_exc.append(l)
bfile.close()
ifile = open(ifname, "rt")
if inplace:
......@@ -49,8 +64,6 @@ def checksipexc(ifname, inplace=False):
ellipsis = '...'
exc_def = 'Exception &sipExceptionRef'
raise_unknown = 'sipRaiseUnknownException();'
raise_exc = ['const char *detail = sipExceptionRef.getErrMsg().c_str();',
'PyErr_SetString(sipException_Exception, detail);']
for line in ifile.readlines():
linenr += 1
......
......@@ -37,7 +37,7 @@ using namespace lima;
%End
%RaiseCode
const std::string& tmpString = sipExceptionRef.getErrMsg();
const char *detail = tmpString.c_str();
const char *detail = tmpString.c_str();
PyErr_SetString(sipException_Exception, detail);
%End
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment