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

OSError on script load. (time package error?) #9

Open
ghost opened this issue Apr 29, 2020 · 2 comments
Open

OSError on script load. (time package error?) #9

ghost opened this issue Apr 29, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Apr 29, 2020

Here is the code that I put in main.py:

import time
import random

while True:
    print(random.random())
    time.sleep(1)

While this works in the normal Python interpreter on my PC, 3DS.py throws this error:
20200428_195406

@vbe0201 vbe0201 added the bug Something isn't working label Apr 29, 2020
@vbe0201
Copy link
Owner

vbe0201 commented Apr 29, 2020

Hello, the first problem is caused due to random.random() depending on the broken hashlib module. This is a known issue and a corresponding fix has already been supplied to my fork of CPython, which is going to be used in the WIP rewrite of 3DS.py.

For the time.sleep error, the issue is known as well, but I haven't found the time to look deeper into it yet. That's why I'm going to leave this issue open as some sort of progress tracker until a patch has been supplied to my Python fork.

@ThatHackerDudeFromCyberspace

I use this instead of time.sleep:

def sleep(seconds):
    start = time.monotonic()
    while(time.monotonic() < start + seconds):
        pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants