From 6c28549cb570b3c84465638fc9d9e6af5febd09c Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 26 Jun 2014 15:25:46 -0400 Subject: [PATCH] mess with sys.path so we can import vendor libraries Signed-off-by: Alfredo Deza --- remoto/lib/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/remoto/lib/__init__.py b/remoto/lib/__init__.py index e0a28cc..8b42e37 100644 --- a/remoto/lib/__init__.py +++ b/remoto/lib/__init__.py @@ -18,11 +18,17 @@ The expected way to import execnet would look like this:: from remoto.lib import execnet """ +import sys +import os +this_dir = os.path.abspath(os.path.dirname(__file__)) +vendor_dir = os.path.join(this_dir, 'vendor') try: # vendored - from vendor import execnet -except ImportError: + if vendor_dir not in sys.path: + sys.path.insert(0, vendor_dir) + import execnet +except ImportError as err: # normally installed import execnet # noqa -- 2.47.3