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
import not working #88
Comments
Hi, could you paste a code snippet that can reproduce this bug? Though from the error message, it looks like you're using cb with threading, which is not supported for now. |
Since I don't get more information, I'll use my best judgement to close this issue, cause it's most likely to be expected due to the reason mentioned above. But feel free to comment if it's not. |
python 3.7.0
|
The test code is here. import struct
import time
from cyberbrain import trace
@trace
def test():
a = b'\x00\x00'*4096
start = time.time()
ans = [0]*(len(a)//2)
for i in range(0, len(a)//2):
ans[i] = int.from_bytes(a[(i*2):(i*2+2)], byteorder='little')
length = len(ans)
data = struct.pack(str(length)+'H', *ans)
stop = time.time()
print(stop-start)
if __name__ == '__main__':
test() |
Hi @joezhouchenye, I tried to run your code on Python 3.7.9 + Win 10, and can't reproduce this error. Could you try using the latest version of Python 3.7 and see if the error still exists? |
It seems that there are some setting problems. I freshly installed python3.7.0 and VS Code on another computer and there is no error. I cannot figure out why yet. |
Sounds good, glad you got it working. |
`Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
cyberbrain==0.1.1
import cyberbrain Exception ignored in: <module 'threading' from '/usr/lib/python3.8/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 1355, in _shutdown def _shutdown(): File "/home/ms/ve/bs2/lib/python3.8/site-packages/cyberbrain/internal/_detect_computed_goto.py", line 9, in global_tracer last_i = frame.f_back.f_lasti # Win: 38, Linux and Mac: 40 AttributeError: 'NoneType' object has no attribute 'f_lasti'
The text was updated successfully, but these errors were encountered: