File tree Expand file tree Collapse file tree
frost_sta_client/odata_codegen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1371,15 +1371,11 @@ def snake(name: str) -> str:
13711371 lines .append ("" )
13721372 lines .append ("" )
13731373
1374+ os .makedirs (out_dir , exist_ok = True )
13741375 # Also write a package __init__.py so that `import <output-dir> as model` works as in README.
13751376 init_path = os .path .join (out_dir , "__init__.py" )
1376- try :
1377- with open (init_path , "w" , encoding = "utf-8" ) as fh :
1378- fh .write (f"from .{ module_name } import *\n " )
1379- except Exception :
1380- # Non-fatal: importing via <out_dir>.<module_name> will still work
1381- pass
1382- os .makedirs (out_dir , exist_ok = True )
1377+ with open (init_path , "w" , encoding = "utf-8" ) as fh :
1378+ fh .write (f"from .{ module_name } import *\n " )
13831379 out_path = os .path .join (out_dir , f"{ module_name } .py" )
13841380 with open (out_path , "w" , encoding = "utf-8" ) as fh :
13851381 fh .write ("\n " .join (lines ) + "\n " )
You can’t perform that action at this time.
0 commit comments