File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Tools/wasm/emscripten/web_example Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,9 @@ const emscriptenSettings = {
70
70
postMessage ( { type : "ready" , stdinBuffer : stdinBuffer . sab } ) ;
71
71
} ,
72
72
async preRun ( Module ) {
73
- const versionHex = Module . HEAPU32 [ Module . _Py_Version / 4 ] . toString ( 16 ) ;
74
- const versionTuple = versionHex
75
- . padStart ( 8 , "0" )
76
- . match ( / .{ 1 , 2 } / g)
77
- . map ( ( x ) => parseInt ( x , 16 ) ) ;
78
- const [ major , minor , ..._ ] = versionTuple ;
73
+ const versionInt = Module . HEAPU32 [ Module . _Py_Version >>> 2 ] ;
74
+ const major = ( versionInt >>> 24 ) & 0xff ;
75
+ const minor = ( versionInt >>> 16 ) & 0xff ;
79
76
// Prevent complaints about not finding exec-prefix by making a lib-dynload directory
80
77
Module . FS . mkdirTree ( `/lib/python${ major } .${ minor } /lib-dynload/` ) ;
81
78
Module . addRunDependency ( "install-stdlib" ) ;
You can’t perform that action at this time.
0 commit comments