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

Cleanup unconditional imports #1753

Merged
merged 9 commits into from
Apr 29, 2021
Merged

Conversation

Arusekk
Copy link
Member

@Arusekk Arusekk commented Dec 29, 2020

This may aid #1725

@@ -1,19 +1,5 @@
from __future__ import absolute_import

from pwnlib.util import crc
Copy link
Member

Choose a reason for hiding this comment

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

It seems that this will break import pwnlib.util and then doing e.g. pwnlib.util.cyclic.xyz, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it will. But!

But this removal saves us partially from the hell of circular imports. Like when pwnlib.xyz uses pwnlib.util.misc, but pwnlib.util.fiddling uses pwnlib.xyz, this is not a circular import normally, but all those imports here make it such if from . import fiddling is before from . import misc. And this sometimes depends on the order of imports elsewhere. So I decided that we can sacrifice convenience in favor of flexibility here.

pwnlib/gdb.py Outdated
@@ -1009,6 +1006,9 @@ def preexec_fn():

if api:
# connect to the GDB Python API bridge
from rpyc import BgServingThread
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Arusekk Arusekk linked an issue Apr 28, 2021 that may be closed by this pull request
@Arusekk Arusekk merged commit 4b196c7 into Gallopsled:dev Apr 29, 2021
@Arusekk Arusekk deleted the cleanup-imports branch April 29, 2021 09:23
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.

Logger class doesn't show the module caller.
2 participants