DanMcInerney / pymetasploit3

Automation library for Metasploit
MIT License
373 stars 92 forks source link

:bug: fixed #47 concurrently call rpc error #48

Closed akkuman closed 4 years ago

akkuman commented 4 years ago
import asyncio

async def main(opts=[]):
    opts.append(123)
    print(id(opts), opts)
    await asyncio.sleep(3)

async def run():
    await asyncio.gather(
        main(),
        main(),
        main(),
    )

asyncio.run(run())

Output:

C:\Users\Akkuman\Desktop>python 1.py
1585842053504 [123]
1585842053504 [123, 123]
1585842053504 [123, 123, 123]