From 4a13ef7072eebb6013af90b2ec062223730f69c9 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 10 Jun 2020 12:04:52 -0400 Subject: Add __main__ logic to slice2py.py (Fixes #893) --- python/scripts/slice2py.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'python/scripts/slice2py.py') diff --git a/python/scripts/slice2py.py b/python/scripts/slice2py.py index 2b04ce81c52..17b9eaeaad1 100755 --- a/python/scripts/slice2py.py +++ b/python/scripts/slice2py.py @@ -3,11 +3,19 @@ # Copyright (c) ZeroC, Inc. All rights reserved. # -import sys, Ice, IcePy +import sys +import Ice +import IcePy + + def main(): sliceDir = Ice.getSliceDir() # Automatically add the slice dir. - if not sliceDir is None: + if sliceDir is not None: sys.argv.append('-I' + sliceDir) val = IcePy.compile(sys.argv) sys.exit(int(val)) + + +if __name__ == "__main__": + sys.exit(main()) -- cgit v1.2.3