From 606fbde1c3968d2db1b7beb954a778a4997905c9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 3 Aug 2016 13:36:22 +0200 Subject: Avoid modification of python system paths This isn't a proper way to solve the import problem, use relative import instead. --- measureit/__init__.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'measureit/__init__.py') diff --git a/measureit/__init__.py b/measureit/__init__.py index 3401a6a6..8e7841fb 100644 --- a/measureit/__init__.py +++ b/measureit/__init__.py @@ -39,18 +39,6 @@ bl_info = { import sys import os -# ---------------------------------------------- -# Add to Phyton path (once only) -# ---------------------------------------------- -path = sys.path -flag = False -for item in path: - if "measureit" in item: - flag = True -if flag is False: - sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'measureit')) - print("measureit: added to phytonpath") - # ---------------------------------------------- # Import modules # ---------------------------------------------- @@ -60,7 +48,7 @@ if "bpy" in locals(): imp.reload(measureit_main) print("measureit: Reloaded multifiles") else: - import measureit_main + from . import measureit_main print("measureit: Imported multifiles") -- cgit v1.2.3