From abcfc0c07f90020ef1fa546f1c9165b24195b52a Mon Sep 17 00:00:00 2001 From: ankostis on tokoti Date: Thu, 17 Sep 2015 01:45:37 +0200 Subject: [PATCH] Replace the last `sys.module` mechancis with relative imports. --- pypiserver/__init__.py | 5 +---- pypiserver/__main__.py | 4 ---- pypiserver/manage.py | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/pypiserver/__init__.py b/pypiserver/__init__.py index 1b72e5f..0915a18 100644 --- a/pypiserver/__init__.py +++ b/pypiserver/__init__.py @@ -17,10 +17,7 @@ def app(root=None, ): import sys import os - from pypiserver import core - sys.modules.pop("pypiserver._app", None) - __import__("pypiserver._app") - _app = sys.modules["pypiserver._app"] + from . import core, _app from . import bottle diff --git a/pypiserver/__main__.py b/pypiserver/__main__.py index 84e2613..ed0bddd 100644 --- a/pypiserver/__main__.py +++ b/pypiserver/__main__.py @@ -296,8 +296,4 @@ def main(argv=None): if __name__ == "__main__": -# if __package__ == "": # running as python pypiserver-...whl/pypiserver? -# import sys -# import os -# sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) main() diff --git a/pypiserver/manage.py b/pypiserver/manage.py index 3dac95a..79c334f 100644 --- a/pypiserver/manage.py +++ b/pypiserver/manage.py @@ -2,7 +2,7 @@ import sys import os from subprocess import call -from pypiserver import core +from . import core import itertools if sys.version_info >= (3, 0):