From ad8e1cbf62db2f6d3b45e520dcb8a6c6b8933b3f Mon Sep 17 00:00:00 2001 From: Raphael Deem Date: Mon, 26 Jun 2017 20:49:41 -0700 Subject: [PATCH] convert environment vars to int if digits --- sanic/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sanic/config.py b/sanic/config.py index e3563bc1..b51f4d0c 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -201,4 +201,7 @@ class Config(dict): for k, v in os.environ.items(): if k.startswith(SANIC_PREFIX): _, config_key = k.split(SANIC_PREFIX, 1) - self[config_key] = v + if v.isdigit(): + self[config_key] = int(v) + else: + self[config_key] = v