PatrickTrentin88 / fzn2omt

Tools/Scripts to convert MiniZinc/FlatZinc to Optimization Modulo Theories (OMT) for BCLT, OptiMathSAT or Z3 and Satisfiability Modulo Theories (SMT) for CVC4.
8 stars 0 forks source link

[Enhancement] Running on Python 3.6 #11

Closed GustavBjordal closed 4 years ago

GustavBjordal commented 4 years ago

I wanted to run fzn2optimathsat.py on some hardware that only had python 3.6 installed.

By changing line 62 of fzn2optimathsat.py from subprocess.run(args, text=True, check=True) into subprocess.run(args, universal_newlines=True, check=True) I can run fzn2optimathsat.py under Python 3.6. It seems that text is just an alias for universal_newlines that was introduced in 3.7 anyway.

Are there any other 3.7 features that are actually used by the script? Otherwise this seems like an easy enhancement for lowering the version requirements.

PatrickTrentin88 commented 4 years ago

Change made, Thanks!