8000 Fix #1777 - Export also PyWorker and current_target (#1779) · pyscript/pyscript@a08f891 · GitHub
[go: up one dir, main page]

Skip to content

Commit a08f891

Browse files
Fix #1777 - Export also PyWorker and current_target (#1779)
1 parent bc1cac9 commit a08f891

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

pyscript.core/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyscript.core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pyscript/core",
3-
"version": "0.2.5",
3+
"version": "0.2.7",
44
"type": "module",
55
"description": "PyScript",
66
"module": "./index.js",

pyscript.core/src/stdlib/pyscript/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# pyscript.magic_js. This is the blessed way to access them from pyscript,
3030
# as it works transparently in both the main thread and worker cases.
3131

32-
from pyscript.magic_js import RUNNING_IN_WORKER, window, document, sync
32+
from pyscript.magic_js import RUNNING_IN_WORKER, PyWorker, window, document, sync, current_target
3333
from pyscript.display import HTML, display
3434

3535
try:

pyscript.core/tests/integration/test_01_basic.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77

88
class TestBasic(PyScriptTest):
9+
def test_pyscript_exports(self):
10+
self.pyscript_run(
11+
"""
12+
<script type="py">
13+
from pyscript import RUNNING_IN_WORKER, PyWorker, window, document, sync, current_target
14+
</script>
15+
"""
16+
)
17+
assert self.console.error.lines == []
18+
919
def test_script_py_hello(self):
1020
self.pyscript_run(
1121
"""

0 commit comments

Comments
 (0)
0