Commit c6b82798 authored by Jim Fulton's avatar Jim Fulton

Added logic to pass the -O option to the child process when -O

was used to start the process. This allows zdaemon-controlled
processes to take advantage of optimization.
parent c2dc8222
...@@ -225,8 +225,12 @@ def run(argv, pidfile=''): ...@@ -225,8 +225,12 @@ def run(argv, pidfile=''):
else: else:
# Child # Child
os.execv(pyth, (pyth,)+tuple(argv)) if __debug__:
# non optimized
os.execv(pyth, (pyth,) + tuple(argv))
else:
# optimized
os.execv(pyth, (pyth, '-O') + tuple(argv))
except ExecError: except ExecError:
sys.exit() sys.exit()
...@@ -249,13 +253,5 @@ def main(): ...@@ -249,13 +253,5 @@ def main():
print 'Error: no script given' print 'Error: no script given'
run(argv, pidf) run(argv, pidf)
if __name__ == '__main__': main() if __name__ == '__main__': main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment