Skip to content

Commit 24d43fd

Browse files
author
Christopher Doris
committed
un-nest try for clearer exception stack [skip ci]
1 parent eea0ad7 commit 24d43fd

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/jlwrap/any.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ function init_jlwrap_any()
192192
ValueBase.__setattr__(self, k, v)
193193
except AttributeError:
194194
if k.startswith("__") and k.endswith("__"):
195-
raise AttributeError(k)
196-
else:
197-
self._jl_callmethod($(pyjl_methodnum(pyjlany_setattr)), k, v)
195+
raise
196+
else:
197+
return
198+
self._jl_callmethod($(pyjl_methodnum(pyjlany_setattr)), k, v)
198199
def __dir__(self):
199200
return ValueBase.__dir__(self) + self._jl_callmethod($(pyjl_methodnum(pyjlany_dir)))
200201
def __call__(self, *args, **kwargs):

src/jlwrap/raw.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ function init_jlwrap_raw()
9999
ValueBase.__setattr__(self, k, v)
100100
except AttributeError:
101101
if k.startswith("__") and k.endswith("__"):
102-
raise AttributeError(k)
103-
else:
104-
self._jl_callmethod($(pyjl_methodnum(pyjlraw_setattr)), k, v)
102+
raise
103+
else:
104+
return
105+
self._jl_callmethod($(pyjl_methodnum(pyjlraw_setattr)), k, v)
105106
def __dir__(self):
106107
return ValueBase.__dir__(self) + self._jl_callmethod($(pyjl_methodnum(pyjlraw_dir)))
107108
def __call__(self, *args, **kwargs):

0 commit comments

Comments
 (0)