From 746d9d2b6b64afb2d89d5c0d8e4857f64947dcb0 Mon Sep 17 00:00:00 2001 From: Rafid Aslam Date: Wed, 14 Dec 2016 17:12:26 +0700 Subject: [PATCH] contrib_bots: Allow to import code from subdirectory of `lib` Allow to import code from subdirectory of `contrib_bots/lib`. Because sometimes bot requires grouping in their directory, especially for the bot that has configuartion file and documentation. --- contrib_bots/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib_bots/run.py b/contrib_bots/run.py index e686472..f351eda 100755 --- a/contrib_bots/run.py +++ b/contrib_bots/run.py @@ -22,7 +22,7 @@ class RestrictedClient(object): def get_lib_module(lib_fn): lib_fn = os.path.abspath(lib_fn) - if os.path.dirname(lib_fn) != os.path.join(our_dir, 'lib'): + if not os.path.dirname(lib_fn).startswith(os.path.join(our_dir, 'lib')): print('Sorry, we will only import code from contrib_bots/lib.') sys.exit(1)