From f0972fc1f84109f7b908c2dc7a1b956121b21fed Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Sun, 16 Sep 2018 16:01:42 +0300 Subject: [PATCH] *types.ModuleType --- srcxray.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/srcxray.py b/srcxray.py index 6f0ad13..f6e0c38 100755 --- a/srcxray.py +++ b/srcxray.py @@ -929,14 +929,14 @@ def main(): else: a1 = sys.argv[1] sys.argv = sys.argv[1:] - if isinstance(eval(a1), types.ModuleType): - ret = eval(a1+".main()") - elif '(' in a1: + if '(' in a1: ret = eval(a1) # ret = exec(sys.argv[1]) + elif len(sys.argv) == 1 and isinstance(eval(a1), types.ModuleType): + ret = eval(a1 + ".main()") else: - ret = eval(a1 + '(' + ', '.join("'%s'" % (a1) - for a1 in sys.argv[1:]) + ')') + ret = eval(a1 + '(' + ', '.join("'%s'" % (a) + for a in sys.argv[1:]) + ')') if isinstance(ret, nx.DiGraph): digraph_print(ret) if isinstance(ret, bool) and ret is False: