brython-dev / brython

Brython (Browser Python) is an implementation of Python 3 running in the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Importation of user module does not work anymore

epeios-q37 opened this issue · comments

Hello,

I use Brython with a module of mine, called atlastk. With Brython version 3.12.2, the importation of this module fails.

Here is the code I use for the testing:

import browser

try:
    import atlastk
except:
    browser.alert("FAILURE!")
else:
    browser.alert("Success.")

Here's the link to test this code with version 3.12.1: https://faas.q37.info/brython/?version=3.12.1&code=import%20browser%0A%0Atry%3A%0A%20%20%20%20import%20atlastk%0Aexcept%3A%0A%20%20%20%20browser.alert%28%22FAILURE!%22%29%0Aelse%3A%0A%20%20%20%20browser.alert%28%22Success.%22%29

By clicking the Run button, you will have (it will take about 10 seconds) the message "Success.", meaning that the importation was successful.

Following link is the same but with version 3.12.2: https://faas.q37.info/brython/?version=3.12.2&code=import%20browser%0A%0Atry%3A%0A%20%20%20%20import%20atlastk%0Aexcept%3A%0A%20%20%20%20browser.alert%28%22FAILURE!%22%29%0Aelse%3A%0A%20%20%20%20browser.alert%28%22Success.%22%29

This time, clicking the Run button will display the message "FAILURE!", meaning that the importation failed.

The problem is that with the version 3.12.1, Brython, to import the atlastk module, uses the (correct) query https://faas.q37.info/brython/atlastk.py, but, with the version 3.12.2, it uses https://cdn.jsdelivr.net/brython/atlastk.py

With the development version, the importation fails too.

Merci de l'avoir signalé tout de suite Claude !
I have published a new version 3.12.3 hopefully fixing this critical bug. Can you check ?

Merci avoir posté cette nouvelle version aussi rapidement, mais…

The importation of a Python module seems to work again, but there is now a problem with the importation of a JS module: #2382