You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, in RFT mode attributes in the base class are renamed, but their usage in the subclass aren't.
Environment:
INFO Python 3.12.6
INFO Pyarmor 8.5.11 (pro)
INFO Platform linux.x86_64
Steps to reproduce
Create a file main.py
class A:
def __init__(self, x):
self.x = x
class B(A):
def get_x(self):
return self.x
if __name__ == '__main__':
b = B(1)
print(b.get_x())
pyarmor cfg enable_rft=1 trace_rft=1
pyarmor gen main.py
python dist/main.py
Result:
Traceback (most recent call last):
File "<frozen __main__>", line 3, in <module>
File "<frozen main>", line 13, in <module>
File "<frozen main>", line 8, in pyarmor__4
AttributeError: 'pyarmor__3' object has no attribute 'x'
RFT trace
pyarmor__6, = __assert_armored__(b'\x84d\xd4p\x94\xe1XhU\x07\xd1\xc5)#\x19\x9eS\xcd?\x90~[R\xe74\x9aj')
class pyarmor__1:
def __init__(self, x):
self.pyarmor__2 = x
class pyarmor__3(pyarmor__1):
def pyarmor__4(self):
return self.x
if __name__ == '__main__':
pyarmor__5 = pyarmor__3(1)
pyarmor__6(pyarmor__5.pyarmor__4())
Expected result: return self.x is changed to return self.pyarmor__2
Additional notes:
Duplicating __init__ in class B fixes the issue but isn't a great solution.
Same issue appears when calling methods defined in parent class, and adding them to exclude table kinda defeats the purpose.
It would be great if subclass support could be added.
The text was updated successfully, but these errors were encountered:
As the title says, in RFT mode attributes in the base class are renamed, but their usage in the subclass aren't.
Environment:
Steps to reproduce
pyarmor cfg enable_rft=1 trace_rft=1
pyarmor gen main.py
python dist/main.py
Result:
RFT trace
Expected result:
return self.x
is changed toreturn self.pyarmor__2
Additional notes:
Duplicating
__init__
inclass B
fixes the issue but isn't a great solution.Same issue appears when calling methods defined in parent class, and adding them to exclude table kinda defeats the purpose.
It would be great if subclass support could be added.
The text was updated successfully, but these errors were encountered: