File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -419,13 +419,16 @@ impl OntoEnv {
419419 let iri = NamedNode :: new ( uri. to_string ( ) )
420420 . map_err ( |e| PyErr :: new :: < pyo3:: exceptions:: PyValueError , _ > ( e. to_string ( ) ) ) ?;
421421 println ! ( "Locking inner" ) ;
422- let inner = self . inner . clone ( ) ;
423- let env = inner. lock ( ) . unwrap ( ) ;
424- println ! ( "Getting graph by name" ) ;
425- let graph = env
426- . get_graph_by_name ( iri. as_ref ( ) )
427- . map_err ( anyhow_to_pyerr) ?;
428- println ! ( "Got graph by name" ) ;
422+ let graph = {
423+ let inner = self . inner . clone ( ) ;
424+ let env = inner. lock ( ) . unwrap ( ) ;
425+ println ! ( "Getting graph by name" ) ;
426+ let graph = env
427+ . get_graph_by_name ( iri. as_ref ( ) )
428+ . map_err ( anyhow_to_pyerr) ?;
429+ println ! ( "Got graph by name" ) ;
430+ graph
431+ } ;
429432 let res = rdflib. getattr ( "Graph" ) ?. call0 ( ) ?;
430433 for triple in graph. into_iter ( ) {
431434 let s: Term = triple. subject . into ( ) ;
You can’t perform that action at this time.
0 commit comments