From 734730640aaae6b971f6d359b022767b0d075850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jotag=C3=AA=20Sales?= Date: Tue, 5 Mar 2019 01:40:17 -0300 Subject: [PATCH] added param package to relative imports --- sanic/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/helpers.py b/sanic/helpers.py index 2634e8e0..1b30e1ad 100644 --- a/sanic/helpers.py +++ b/sanic/helpers.py @@ -137,7 +137,7 @@ def remove_entity_headers(headers, allowed=("content-location", "expires")): return headers -def import_string(module_name): +def import_string(module_name, package=None): """ import a module or class by string path. @@ -148,7 +148,7 @@ def import_string(module_name): """ module, klass = module_name.rsplit(".", 1) - module = import_module(module) + module = import_module(module, package=package) obj = getattr(module, klass) if ismodule(obj): return obj