forked from orbit-oss/flask
app.name shall be __main__ for console apps
This commit is contained in:
parent
56afafae67
commit
d2eefe25e7
1 changed files with 1 additions and 1 deletions
|
|
@ -466,7 +466,7 @@ class Flask(_PackageBoundObject):
|
||||||
if self.import_name == '__main__':
|
if self.import_name == '__main__':
|
||||||
fn = getattr(sys.modules['__main__'], '__file__', None)
|
fn = getattr(sys.modules['__main__'], '__file__', None)
|
||||||
if fn is None:
|
if fn is None:
|
||||||
return 'unknown'
|
return '__main__'
|
||||||
return os.path.splitext(os.path.basename(fn))[0]
|
return os.path.splitext(os.path.basename(fn))[0]
|
||||||
return self.import_name
|
return self.import_name
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue