Better file existance checks.

pull/749/head
Jussi Pakkanen 9 years ago
parent cdf0c4f1a9
commit c8213aaf1e
  1. 7
      mesonbuild/mesonlib.py
  2. 6
      test cases/common/16 configure file/generator.py

@ -95,12 +95,7 @@ def is_32bit():
return not(sys.maxsize > 2**32)
def is_debianlike():
try:
with open('/etc/debian_version', 'r'):
pass
return True
except FileNotFoundError:
return False
return os.path.isfile('/etc/debian_version')
def exe_exists(arglist):
try:

@ -1,13 +1,11 @@
#!/usr/bin/env python3
import sys
import sys, os
if len(sys.argv) != 3:
print("Wrong amount of parameters.")
# Just test that it exists.
with open(sys.argv[1], 'r') as ifile:
pass
assert(os.path.exists(sys.argv[1]))
with open(sys.argv[2], 'w') as ofile:
ofile.write("#define ZERO_RESULT 0\n")

Loading…
Cancel
Save