@@ -997,7 +997,7 @@ def _import(
997
997
top_level : bool = False ,
998
998
source : Optional [str ] = None ,
999
999
parent_import : Optional [Import ] = None ,
1000
- ) -> Tuple [ Optional [LibraryEntry ], Optional [ Dict [ str , Any ]] ]:
1000
+ ) -> Optional [LibraryEntry ]:
1001
1001
result : Optional [LibraryEntry ] = None
1002
1002
try :
1003
1003
if isinstance (value , LibraryImport ):
@@ -1181,7 +1181,7 @@ def _import(
1181
1181
finally :
1182
1182
self ._reset_global_variables ()
1183
1183
1184
- return result , variables
1184
+ return result
1185
1185
1186
1186
def _import_imports (
1187
1187
self ,
@@ -1193,7 +1193,7 @@ def _import_imports(
1193
1193
source : Optional [str ] = None ,
1194
1194
parent_import : Optional [Import ] = None ,
1195
1195
depth : int = 0 ,
1196
- ) -> None :
1196
+ ) -> Optional [ Dict [ str , Any ]] :
1197
1197
1198
1198
current_time = time .monotonic ()
1199
1199
self ._logger .debug (lambda : f"{ ' ' * depth } start imports for { self .document if top_level else source } " )
@@ -1202,7 +1202,7 @@ def _import_imports(
1202
1202
if variables is None :
1203
1203
variables = self .get_resolvable_variables ()
1204
1204
1205
- entry , variables = self ._import (
1205
+ entry = self ._import (
1206
1206
imp ,
1207
1207
variables = variables ,
1208
1208
base_dir = base_dir ,
@@ -1225,7 +1225,7 @@ def _import_imports(
1225
1225
variables = self .get_resolvable_variables ()
1226
1226
1227
1227
try :
1228
- self ._import_imports (
1228
+ variables = self ._import_imports (
1229
1229
entry .imports ,
1230
1230
str (Path (entry .library_doc .source ).parent ),
1231
1231
top_level = False ,
@@ -1388,6 +1388,8 @@ def _import_imports(
1388
1388
f"{ self .document if top_level else source } in { time .monotonic () - current_time } s"
1389
1389
)
1390
1390
1391
+ return variables
1392
+
1391
1393
def _import_default_libraries (self , variables : Optional [Dict [str , Any ]] = None ) -> None :
1392
1394
def _import_lib (library : str , variables : Optional [Dict [str , Any ]] = None ) -> Optional [LibraryEntry ]:
1393
1395
try :
0 commit comments