File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -99,17 +99,19 @@ export default {
9999 // packages are uniquely stored as JSON key
100100 const key = stringify ( packages ) ;
101101 if ( storage . has ( key ) ) {
102- const blob = new Blob (
103- [ storage . get ( key ) ] ,
104- { type : 'application/json' } ,
105- ) ;
106- // this should be used to bootstrap loadPyodide
107- options . lockFileURL = URL . createObjectURL ( blob ) ;
108- // versions are not currently understood by pyodide when
109- // a lockFileURL is used instead of micropip.install(packages)
110- // https://github.com/pyodide/pyodide/issues/5135#issuecomment-2441038644
111- // https://github.com/pyscript/pyscript/issues/2245
112- options . packages = packages . map ( name => name . split ( / [ > = < ] = / ) [ 0 ] ) ;
102+ const value = storage . get ( key ) ;
103+ if ( save && ! version . startsWith ( '0.27' ) )
104+ options . lockFileContents = Promise . resolve ( value ) ;
105+ else {
106+ const blob = new Blob ( [ value ] , { type : 'application/json' } ) ;
107+ // this should be used to bootstrap loadPyodide
108+ options . lockFileURL = URL . createObjectURL ( blob ) ;
109+ // versions are not currently understood by pyodide when
110+ // a lockFileURL is used instead of micropip.install(packages)
111+ // https://github.com/pyodide/pyodide/issues/5135#issuecomment-2441038644
112+ // https://github.com/pyscript/pyscript/issues/2245
113+ options . packages = packages . map ( name => name . split ( / [ > = < ] = / ) [ 0 ] ) ;
114+ }
113115 packages = null ;
114116 }
115117 }
You can’t perform that action at this time.
0 commit comments