this drops another static binary and replaces it with a very small shell^Wpython script (again, python used to avoid sed / grep implementation differences)
16 lines
334 B
Python
Executable file
16 lines
334 B
Python
Executable file
#!/usr/bin/env python
|
|
|
|
import re, sys, subprocess, os
|
|
|
|
stlfile = sys.argv[3] + '.stl'
|
|
|
|
subprocess.check_call([sys.argv[2], sys.argv[1], '-o', stlfile])
|
|
|
|
result = open(stlfile).read()
|
|
|
|
os.unlink(stlfile)
|
|
|
|
if 'nan' in result or 'inf' in result:
|
|
sys.exit(1)
|
|
|
|
open(sys.argv[3], 'w').write('') # this check only works on return values
|