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

dill.source.findsource fails when in asyncio REPL #627

Open
jarmitage opened this issue Oct 25, 2023 · 0 comments
Open

dill.source.findsource fails when in asyncio REPL #627

jarmitage opened this issue Oct 25, 2023 · 0 comments

Comments

@jarmitage
Copy link

Minimal repro in python -m asyncio:

import dill

def f(x):
  return x*x

dill.source.findsource(f) # prints out `asyncio.__main__`

This commit demonstrates a hotfix: jarmitage@e611d8b

But this also does not work for other derivative REPLs based on Asyncio, for example Sardine: https://github.com/Bubobubobubobubo/sardine/blob/main/sardine/console.py

So it could also be is_module_main = (module and module.__name__ == '__main__' and not file) or file=='<console>'

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

1 participant