deprecate None value support for app name (#1705)

*  deprecate None value support for app name

* 🚨 cleanup linter issues across the codebase
This commit is contained in:
Harsha Narayana
2019-10-23 21:42:20 +05:30
committed by 7
parent fcdc9c83c5
commit e506c89304
5 changed files with 101 additions and 57 deletions

View File

@@ -46,6 +46,13 @@ class Sanic:
# Get name from previous stack frame
if name is None:
warnings.warn(
"Sanic(name=None) is deprecated and None value support "
"for `name` will be removed in the next release. "
"Please use Sanic(name='your_application_name') instead.",
DeprecationWarning,
stacklevel=2,
)
frame_records = stack()[1]
name = getmodulename(frame_records[1])