Weird inheritance assertion difference between embedded library and interpreter
Posted: Tue Dec 14, 2021 8:30 am
Hey all,
I am trying to use the static library in example/embedding to try and run on a unix system.
When I do so, the following code throws an assertion error:
The assertion that occurs is on py/objdict.c - line 375,
When I run this with the `port/unix` however, this works just fine...
Can anyone please shed some light on this?
I am trying to use the static library in example/embedding to try and run on a unix system.
When I do so, the following code throws an assertion error:
Code: Select all
class _Environ(dict):
def __init__(self):
dict.__init__(self) <------ That is the line that fails :_( :_(
env = uctypes.struct(_environ_ptr.get(), _ENV_STRUCT)
for i in range(4096):
if int(env.arr[i]) == 0:
break
s = uctypes.bytes_at(env.arr[i]).decode()
k, v = s.split("=", 1)
dict.__setitem__(self, k, v)
def __setitem__(self, k, v):
putenv(k, v)
dict.__setitem__(self, k, v)
environ = _Environ()
Code: Select all
mp_check_self(mp_obj_is_dict_or_ordereddict(..))
Can anyone please shed some light on this?