Fix erratically failing threads_exception python test

This commit is contained in:
William S Fulton 2013-03-23 16:52:30 +00:00
commit b504b68a62
2 changed files with 7 additions and 4 deletions

View file

@ -23,10 +23,12 @@ except RuntimeError,e:
try: try:
t.hosed() t.hosed()
except threads_exception.Exc,e: except threads_exception.Exc,e:
if e.code != 42: code = e.code
raise RuntimeError if code != 42:
if e.msg != "Hosed": raise RuntimeError, "bad... code: %d" % code
raise RuntimeError, "bad... msg: %s" % e.msg msg = e.msg
if msg != "Hosed":
raise RuntimeError, "bad... msg: '%s' len: %d" % (msg, len(msg))
for i in range(1,4): for i in range(1,4):
try: try:

View file

@ -20,6 +20,7 @@ public:
Exc(int c, const char *m) { Exc(int c, const char *m) {
code = c; code = c;
strncpy(msg,m,255); strncpy(msg,m,255);
msg[255] = 0;
} }
int code; int code;
char msg[256]; char msg[256];