@@ -327,15 +327,15 @@ async def write_fig_from_object(
327327 tasks : set [asyncio .Task ] = set ()
328328
329329 try :
330- async for args in _utils .ensure_async_iter (generator ):
330+ async for fig_arg in _utils .ensure_async_iter (generator ):
331331 spec = _fig_tools .coerce_for_js (
332- args .get ("fig" ),
333- args .get ("path" , None ),
334- args .get ("opts" , None ),
332+ fig_arg .get ("fig" ),
333+ fig_arg .get ("path" , None ),
334+ fig_arg .get ("opts" , None ),
335335 )
336336
337337 full_path = _path_tools .determine_path (
338- args .get ("path" , None ),
338+ fig_arg .get ("path" , None ),
339339 spec ["data" ],
340340 spec ["format" ], # should just take spec
341341 )
@@ -344,7 +344,7 @@ async def write_fig_from_object(
344344 self ._render_task (
345345 spec = spec ,
346346 write_path = full_path if _write else None , # bwrds - compat!
347- topojson = args .get ("topojson" ),
347+ topojson = fig_arg .get ("topojson" ),
348348 ),
349349 )
350350 tasks .add (t )
@@ -369,7 +369,10 @@ async def write_fig(
369369 cancel_on_error = False ,
370370 ) -> tuple [None | Exception ]: # TODO this should be filtered
371371 """Temp."""
372- if not isinstance (fig , (Iterable , AsyncIterable )):
372+ if _fig_tools .is_figurish (fig ) or not isinstance (
373+ fig ,
374+ (Iterable , AsyncIterable ),
375+ ):
373376 fig = [fig ]
374377
375378 async def _temp_generator ():
0 commit comments