forked from pyodide/pyodide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add _pyodide_core C extension module (pyodide#1090)
- Loading branch information
Hood Chatham
authored
Jan 11, 2021
1 parent
e8e341f
commit 3548683
Showing
8 changed files
with
111 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# type: ignore | ||
import platform | ||
|
||
if platform.system() == "Emscripten": | ||
from _pyodide_core import JsProxy, JsBoundMethod, JsException | ||
else: | ||
# Can add shims here if we are so inclined. | ||
class JsException(Exception): | ||
""" | ||
A wrapper around a Javascript Error to allow the Error to be thrown in Python. | ||
""" | ||
|
||
# Defined in jsproxy.c | ||
|
||
class JsProxy: | ||
"""A proxy to make a Javascript object behave like a Python object""" | ||
|
||
# Defined in jsproxy.c | ||
|
||
class JsBoundMethod: | ||
"""A proxy to make it possible to call Javascript bound methods from Python.""" | ||
|
||
# Defined in jsproxy.c | ||
|
||
|
||
__all__ = [JsProxy, JsBoundMethod, JsException] |