Skip to content

OSError: could not get source code #103

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

Closed
Elefant-Freeciv opened this issue Jan 4, 2024 · 2 comments
Closed

OSError: could not get source code #103

Elefant-Freeciv opened this issue Jan 4, 2024 · 2 comments

Comments

@Elefant-Freeciv
Copy link

The error message: Traceback (most recent call last): File "<string>", line 16, in <module> File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/parallel.py", line 573, in __call__ self.elementwise(*args, **kwargs) File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/profile.py", line 72, in wrapper return method(*args, **kwargs) File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/jit.py", line 355, in __call__ c_func = self._generate_kernel(*args) File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/jit.py", line 29, in wrapper setattr(f, 'cached_kernel', {key_val: method(*args)}) File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/jit.py", line 341, in _generate_kernel declarations = helper.annotate() File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/jit.py", line 160, in annotate src = dedent('\n'.join(getsourcelines(self.func)[0])) File "/home/user/miniconda3/lib/python3.11/site-packages/compyle/utils.py", line 13, in getsourcelines return inspect.getsourcelines(obj) File "/home/user/miniconda3/lib/python3.11/inspect.py", line 1244, in getsourcelines lines, lnum = findsource(object) File "/home/user/miniconda3/lib/python3.11/inspect.py", line 1081, in findsource raise OSError('could not get source code') OSError: could not get source code

Steps to reproduce: install compyle with pip (latest version from git) and run the default example.

@Elefant-Freeciv
Copy link
Author

getfile(object) just before the error returns instead of <path/to/file>

@Elefant-Freeciv
Copy link
Author

Error is due to running file without saving first in Thonny. As such it is probably a bug in Thonny and not this project.

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