3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 12:58:44 +00:00

ML API: fixed Python 3.4 issues in the build scripts

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2015-01-19 15:29:50 +00:00
parent e754aa1c11
commit c9fa77cc70
2 changed files with 9 additions and 9 deletions

View file

@ -344,12 +344,12 @@ def check_ml():
t.add('print_string "Hello world!\n";;') t.add('print_string "Hello world!\n";;')
t.commit() t.commit()
if is_verbose(): if is_verbose():
print "Testing %s..." % OCAMLC print ('Testing %s...' % OCAMLC)
r = exec_cmd([OCAMLC, '-o', 'a.out', 'hello.ml']) r = exec_cmd([OCAMLC, '-o', 'a.out', 'hello.ml'])
if r != 0: if r != 0:
raise MKException('Failed testing ocamlc compiler. Set environment variable OCAMLC with the path to the Ocaml compiler') raise MKException('Failed testing ocamlc compiler. Set environment variable OCAMLC with the path to the Ocaml compiler')
if is_verbose(): if is_verbose():
print "Testing %s..." % OCAMLOPT print ('Testing %s...' % OCAMLOPT)
r = exec_cmd([OCAMLOPT, '-o', 'a.out', 'hello.ml']) r = exec_cmd([OCAMLOPT, '-o', 'a.out', 'hello.ml'])
if r != 0: if r != 0:
raise MKException('Failed testing ocamlopt compiler. Set environment variable OCAMLOPT with the path to the Ocaml native compiler. Note that ocamlopt may require flexlink to be in your path.') raise MKException('Failed testing ocamlopt compiler. Set environment variable OCAMLOPT with the path to the Ocaml native compiler. Note that ocamlopt may require flexlink to be in your path.')
@ -364,7 +364,7 @@ def check_ml():
def find_ocaml_find(): def find_ocaml_find():
global OCAMLFIND global OCAMLFIND
if is_verbose(): if is_verbose():
print "Testing %s..." % OCAMLFIND print ('Testing %s...' % OCAMLFIND)
r = exec_cmd([OCAMLFIND, 'printconf']) r = exec_cmd([OCAMLFIND, 'printconf'])
if r != 0: if r != 0:
OCAMLFIND='' OCAMLFIND=''
@ -372,7 +372,7 @@ def find_ocaml_find():
def find_ml_lib(): def find_ml_lib():
global OCAML_LIB global OCAML_LIB
if is_verbose(): if is_verbose():
print "Finding OCAML_LIB..." print ('Finding OCAML_LIB...')
t = TempFile('output') t = TempFile('output')
null = open(os.devnull, 'wb') null = open(os.devnull, 'wb')
try: try:
@ -384,7 +384,7 @@ def find_ml_lib():
for line in t: for line in t:
OCAML_LIB = line[:-1] OCAML_LIB = line[:-1]
if is_verbose(): if is_verbose():
print 'OCAML_LIB=%s' % OCAML_LIB print ('OCAML_LIB=%s' % OCAML_LIB)
t.close() t.close()
rmf('output') rmf('output')
return return
@ -2810,7 +2810,7 @@ def mk_z3consts_ml(api_files):
linenum = linenum + 1 linenum = linenum + 1
efile.write('end\n') efile.write('end\n')
if VERBOSE: if VERBOSE:
print "Generated '%s/z3enums.ml'" % ('%s' % gendir) print ('Generated "%s/z3enums.ml"' % ('%s' % gendir))
efile = open('%s.mli' % os.path.join(gendir, "z3enums"), 'w') efile = open('%s.mli' % os.path.join(gendir, "z3enums"), 'w')
efile.write('(* Automatically generated file *)\n\n') efile.write('(* Automatically generated file *)\n\n')
efile.write('(** The enumeration types of Z3. *)\n\n') efile.write('(** The enumeration types of Z3. *)\n\n')
@ -2880,7 +2880,7 @@ def mk_z3consts_ml(api_files):
idx = idx + 1 idx = idx + 1
linenum = linenum + 1 linenum = linenum + 1
if VERBOSE: if VERBOSE:
print "Generated '%s/z3enums.mli'" % ('%s' % gendir) print ('Generated "%s/z3enums.mli"' % ('%s' % gendir))
def mk_gui_str(id): def mk_gui_str(id):
return '4D2F40D8-E5F9-473B-B548-%012d' % id return '4D2F40D8-E5F9-473B-B548-%012d' % id

View file

@ -276,7 +276,7 @@ def param2dotnet(p):
elif k == OUT_ARRAY: elif k == OUT_ARRAY:
return "[Out] %s[]" % type2dotnet(param_type(p)) return "[Out] %s[]" % type2dotnet(param_type(p))
elif k == OUT_MANAGED_ARRAY: elif k == OUT_MANAGED_ARRAY:
return "[Out] out %s[]" % type2dotnet(param_type(p)) return "[Out] out %s[]" % type2dotnet(param_type(p))
else: else:
return type2dotnet(param_type(p)) return type2dotnet(param_type(p))
@ -1517,7 +1517,7 @@ def mk_ml():
ml_wrapper.write('}\n') ml_wrapper.write('}\n')
ml_wrapper.write('#endif\n') ml_wrapper.write('#endif\n')
if is_verbose(): if is_verbose():
print "Generated '%s'" % ml_nativef print ('Generated "%s"' % ml_nativef)
# Collect API(...) commands from # Collect API(...) commands from
def def_APIs(): def def_APIs():