From 9b20750456325acab4add1f2e253081ea0df3711 Mon Sep 17 00:00:00 2001 From: Elliott Jin Date: Mon, 22 May 2017 15:42:40 -0700 Subject: [PATCH] bots: Allow symlinks in bot paths provided to run.py. run.py requires that the location of the provided bot matches the location of run.py. However, run.py previously failed in the case where the location included a symlink. --- 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 3bec299..3df9fc2 100755 --- a/contrib_bots/run.py +++ b/contrib_bots/run.py @@ -13,7 +13,7 @@ sys.path.insert(0, our_dir) from bot_lib import run_message_handler_for_bot def get_lib_module(bots_fn): - bots_fn = os.path.abspath(bots_fn) + bots_fn = os.path.realpath(bots_fn) if not os.path.dirname(bots_fn).startswith(os.path.join(our_dir, 'bots')): print('Sorry, we will only import code from contrib_bots/bots.') sys.exit(1)