8000 Use `substring()` instead of `substr()` (#341) · sarvjeetdev/pyscript@86eb771 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86eb771

Browse files
authored
Use substring() instead of substr() (pyscript#341)
1 parent a3e86f3 commit 86eb771

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyscriptjs/src/interpreter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const loadInterpreter = async function (indexUrl:string): Promise<any> {
2323
// let's get the full path of where PyScript is running from so we can load the pyscript.py
2424
// file from the same location
2525
const loadedScript: HTMLScriptElement = document.querySelector(`script[src$='pyscript.js']`);
26-
const scriptPath = loadedScript.src.substr(0, loadedScript.src.lastIndexOf('/'));
26+
const scriptPath = loadedScript.src.substring(0, loadedScript.src.lastIndexOf('/'));
2727
await pyodide.runPythonAsync(await (await fetch(`${scriptPath}/pyscript.py`)).text());
2828

2929
console.log(scriptPath);

0 commit comments

Comments
 (0)
0