Closed samhld closed 4 years ago
What's the scenario? Where is your function defined? In a code file, in a shell, and if so what shell?
On Fri, Oct 18, 2019, 03:34 Sam Dillard notifications@github.com wrote:
Overall, this is working for me but instead of getting the line of code that's being evaluated, I'm getting a constant SOURCE UNAVAILABLE message. It looks like this is called from here https://github.com/cool-RR/PySnooper/blob/master/pysnooper/tracer.py#L89. Not sure why it's not a "source" though. Can you help? Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cool-RR/PySnooper/issues/164?email_source=notifications&email_token=AAAN3SSXO3L76CZ7YDFBMJLQPEAB3A5CNFSM4JCBAQW2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HSTQGAA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3SWEK3LPCTQCCG4VUQ3QPEAB3ANCNFSM4JCBAQWQ .
@cool-RR it's defined in a python3 interactive shell. Sounds like maybe I don't understand what "source" means in this case?
The source code isn't saved anywhere in a regular shell. If you write code that raises an exception you'll see that code doesn't show in the traceback either.
@alexmojaki is correct. If you were to suggest to python-ideas to start saving source code on code objects, I would support that suggestion, and that would make this feature possible. I think that they're unlikely to accept it, but let me know if you try.
thanks, guys! Clears that up.
Overall, this is working for me but instead of getting the line of code that's being evaluated, I'm getting a constant
SOURCE UNAVAILABLE
message. It looks like this is called from here. Not sure why it's not a "source" though. Can you help? Thanks!This is happening on a very basic function, say:
Returns: