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

import not working #88

Closed
pythonms opened this issue Feb 10, 2021 · 7 comments
Closed

import not working #88

pythonms opened this issue Feb 10, 2021 · 7 comments
Labels
needs more info More information is needed from the bug reporter

Comments

@pythonms
Copy link

pythonms commented Feb 10, 2021

`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'

@laike9m
Copy link
Owner

laike9m commented Feb 10, 2021

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.

@laike9m
Copy link
Owner

laike9m commented Feb 11, 2021

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.

@laike9m laike9m closed this as completed Feb 11, 2021
@joezhouchenye
Copy link

python 3.7.0
Cyberbrain 0.1.4
Windows 10
Similar problem in the Terminal, the graph shows up though.

Exception ignored in: <async_generator object _ag at 0x000002085F2651E0>
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\types.py", line 27, in _ag
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\cyberbrain\internal\_detect_computed_goto.py", line 9, in global_tracer
AttributeError: 'NoneType' object has no attribute 'f_lasti'

@joezhouchenye
Copy link

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()

@laike9m laike9m reopened this Apr 13, 2021
@laike9m laike9m added this to To do in Cyberbrain's Kanban via automation Apr 13, 2021
@laike9m laike9m moved this from To do to In progress in Cyberbrain's Kanban Apr 13, 2021
@laike9m
Copy link
Owner

laike9m commented Apr 18, 2021

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?

@laike9m laike9m added the needs more info More information is needed from the bug reporter label Apr 18, 2021
@joezhouchenye
Copy link

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.

@laike9m
Copy link
Owner

laike9m commented Apr 21, 2021

Sounds good, glad you got it working.

@laike9m laike9m closed this as completed Apr 21, 2021
Cyberbrain's Kanban automation moved this from In progress to Done Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info More information is needed from the bug reporter
Projects
Development

No branches or pull requests

3 participants