Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix changes introduced to volatility3.framework.constants in PRs #838 #1268

Merged

Conversation

gcmoreira
Copy link
Contributor

Trying to use the changes in #1247 I found that the following works

>>> from volatility3.framework.constants.architectures import LINUX_ARCHS
>>> LINUX_ARCHS
['Intel32', 'Intel64']

However, the following fails:

>>> from volatility3.framework.constants import architectures
>>> architectures.LINUX_ARCHS
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'LINUX_ARCHS'

Debugging why the import doesn't fail but instead gets a None, which is really weird, I found this happens because the changes introduced to support deprecated constants in PRs #838 in this line.

Completely removing the __getattr__() function works as expected.

>>> from volatility3.framework.constants import architectures
>>> architectures.LINUX_ARCHS
['Intel32', 'Intel64']

The changes in this PR keep the __getattr__() function while still allowing the use of sub-modules of volatility3.framework.constants.

>>> from volatility3.framework.constants import architectures
>>> architectures.LINUX_ARCHS
['Intel32', 'Intel64']

Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, sorry for the mistake first time around.... 5:)

@ikelos ikelos merged commit bb6ab45 into volatilityfoundation:develop Sep 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants