INNER CODE UNIT · Python
_main_file_path
rio-labs/rio · rio/app.py:497
def _main_file_path(self) -> Path:
if global_state.rio_run_app_module_path is not None:
main_file = global_state.rio_run_app_module_path
else:
try:
main_file = Path(__main__.__file__)
except AttributeError:
main_file = Path(sys.argv[0])
# Find out if we're being executed by uvicorn
if (
main_file.name != "__main__.py"
or main_file.parent != Path(uvicorn.__file__).parent
):
return main_file
# Find out from which module uvicorn imported the app
try: