mirror of
https://github.com/pyodide/pyodide.git
synced 2025-12-03 12:33:40 +00:00
Remove pyxhr imports from http/__init__.py (#5953)
And rename _pyxhr.py to pyxhr.py.
This commit is contained in:
@@ -64,7 +64,7 @@ def set_configs():
|
||||
pyodide._api.pyodide_ffi.register_js_module;
|
||||
pyodide._api.pyodide_ffi.unregister_js_module;
|
||||
pyodide.pyimport("pyodide.ffi.wrappers").destroy();
|
||||
pyodide.pyimport("pyodide.http").destroy();
|
||||
pyodide.pyimport("pyodide.http.pyxhr").destroy();
|
||||
pyodide.pyimport("pyodide_js._api");
|
||||
""")
|
||||
|
||||
|
||||
@@ -2,16 +2,12 @@ from io import StringIO
|
||||
|
||||
# Keep open_url in __init__ for now, will be moved to pyxhr.py later
|
||||
from ..ffi import IN_BROWSER
|
||||
from . import _pyxhr as pyxhr
|
||||
from ._exceptions import (
|
||||
AbortError,
|
||||
BodyUsedError,
|
||||
HttpStatusError,
|
||||
XHRError,
|
||||
XHRNetworkError,
|
||||
)
|
||||
from ._pyfetch import FetchResponse, pyfetch
|
||||
from ._pyxhr import XHRRequestParams, XHRResponse
|
||||
|
||||
if IN_BROWSER:
|
||||
try:
|
||||
@@ -26,11 +22,6 @@ __all__ = [
|
||||
"HttpStatusError",
|
||||
"BodyUsedError",
|
||||
"AbortError",
|
||||
"pyxhr",
|
||||
"XHRResponse",
|
||||
"XHRRequestParams",
|
||||
"XHRError",
|
||||
"XHRNetworkError",
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,20 @@ if IN_BROWSER:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
__all__ = [
|
||||
"delete",
|
||||
"get",
|
||||
"head",
|
||||
"options",
|
||||
"patch",
|
||||
"post",
|
||||
"put",
|
||||
"XHRError",
|
||||
"XHRNetworkError",
|
||||
"XHRRequestParams",
|
||||
"XHRResponse",
|
||||
]
|
||||
|
||||
|
||||
class XHRRequestParams(TypedDict):
|
||||
"""Parameters for XMLHttpRequest operations."""
|
||||
Reference in New Issue
Block a user