diff options
author | Joe George <joe@zeroc.com> | 2020-06-10 12:04:52 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2020-06-10 12:05:39 -0400 |
commit | 4a13ef7072eebb6013af90b2ec062223730f69c9 (patch) | |
tree | b638d73e611891b78b953ea92212351bb769e1f7 /python | |
parent | Escape xml testcase name (diff) | |
download | ice-4a13ef7072eebb6013af90b2ec062223730f69c9.tar.bz2 ice-4a13ef7072eebb6013af90b2ec062223730f69c9.tar.xz ice-4a13ef7072eebb6013af90b2ec062223730f69c9.zip |
Add __main__ logic to slice2py.py (Fixes #893)
Diffstat (limited to 'python')
-rwxr-xr-x | python/scripts/slice2py.py | 12 |
1 files changed, 10 insertions, 2 deletions
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()) |