PyUpgrade 3.8 updates (#15941)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
ea13dc6208
commit
9ec8e9acbf
13 changed files with 25 additions and 25 deletions
|
|
@ -55,23 +55,22 @@ def request_with_credentials(url: str) -> any:
|
|||
|
||||
display.display(
|
||||
display.Javascript(
|
||||
"""
|
||||
window._hub_tmp = new Promise((resolve, reject) => {
|
||||
f"""
|
||||
window._hub_tmp = new Promise((resolve, reject) => {{
|
||||
const timeout = setTimeout(() => reject("Failed authenticating existing browser session"), 5000)
|
||||
fetch("%s", {
|
||||
fetch("{url}", {{
|
||||
method: 'POST',
|
||||
credentials: 'include'
|
||||
})
|
||||
}})
|
||||
.then((response) => resolve(response.json()))
|
||||
.then((json) => {
|
||||
.then((json) => {{
|
||||
clearTimeout(timeout);
|
||||
}).catch((err) => {
|
||||
}}).catch((err) => {{
|
||||
clearTimeout(timeout);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}});
|
||||
}});
|
||||
"""
|
||||
% url
|
||||
)
|
||||
)
|
||||
return output.eval_js("_hub_tmp")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue