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

python importing modules into functions #27

Open
majandres opened this issue Oct 27, 2020 · 1 comment
Open

python importing modules into functions #27

majandres opened this issue Oct 27, 2020 · 1 comment
Assignees

Comments

@majandres
Copy link

majandres commented Oct 27, 2020

Hello Santiago,

I'm trying to use the sleep function from the time module, but when I import in the function, I get an error

Exception ignored in: 'netfilterqueue.global_callback'
Traceback (most recent call last):
  File "/home/andres/polymorph/venv/lib/python3.8/site-packages/polymorph/interceptor.py", line 69, in linux_modify
    pkt = function(self.packet)
TypeError: 'module' object is not callable

how could I use sleep in a function?

thank you

@shramos
Copy link
Owner

shramos commented Oct 30, 2020

Hi @majandres,

Try to perform the import within the function:

def test_func(packet):
    import time
    time.sleep(4)
    return packet

@shramos shramos self-assigned this Oct 30, 2020
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

No branches or pull requests

2 participants