Skip to content

bug in core.py #877

@PythonBen

Description

@PythonBen

In line 802 we import the function run from uvicorn.
in line 813 the function is called uvicorn.run() but it should be run()

from uvicorn import run
bk = inspect.currentframe().f_back
glb = bk.f_globals
code = bk.f_code
if not appname:
if glb.get('name')=='main': appname = Path(glb.get('file', '')).stem
elif code.co_name=='main' and bk.f_back.f_globals.get('name')=='main': appname = inspect.getmodule(bk).name
if appname:
if not port: port=int(os.getenv("PORT", default=5001))
link = f'http://{"localhost" if host=="0.0.0.0" else host}:{port}'
print('Link: '+ S.light_red.bold(link))
uvicorn.run(f'{appname}:{app}', host=host, port=port, reload=reload, **kwargs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions