[py] minor, replace os.environ.get with os.getenv

pull/2538/head
Ebrahim Byagowi 5 years ago
parent 43e3ab019c
commit a07672d353
  1. 6
      src/check-c-linkage-decls.py
  2. 4
      src/check-externs.py
  3. 6
      src/check-header-guards.py
  4. 6
      src/check-includes.py
  5. 4
      src/check-libstdc++.py
  6. 4
      src/check-static-inits.py
  7. 4
      src/check-symbols.py
  8. 2
      src/gen-def.py
  9. 12
      test/fuzzing/run-draw-fuzzer-tests.py
  10. 12
      test/fuzzing/run-shape-fuzzer-tests.py
  11. 12
      test/fuzzing/run-subset-fuzzer-tests.py
  12. 2
      test/shaping/data/aots/update.py
  13. 2
      test/shaping/data/text-rendering-tests/update.py
  14. 4
      write-tarball-revision.py

@ -2,11 +2,11 @@
import sys, os
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
HBHEADERS = [os.path.basename (x) for x in os.environ.get ('HBHEADERS', '').split ()] or \
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
HBSOURCES = [os.path.basename (x) for x in os.environ.get ('HBSOURCES', '').split ()] or \
HBSOURCES = [os.path.basename (x) for x in os.getenv ('HBSOURCES', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))]
stat = 0

@ -2,9 +2,9 @@
import sys, os, re
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
HBHEADERS = [os.path.basename (x) for x in os.environ.get ('HBHEADERS', '').split ()] or \
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
stat = 0

@ -2,11 +2,11 @@
import sys, os, re
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
HBHEADERS = [os.path.basename (x) for x in os.environ.get ('HBHEADERS', '').split ()] or \
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
HBSOURCES = [os.path.basename (x) for x in os.environ.get ('HBSOURCES', '').split ()] or \
HBSOURCES = [os.path.basename (x) for x in os.getenv ('HBSOURCES', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))]
stat = 0

@ -2,11 +2,11 @@
import sys, os, re
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
HBHEADERS = [os.path.basename (x) for x in os.environ.get ('HBHEADERS', '').split ()] or \
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
HBSOURCES = [os.path.basename (x) for x in os.environ.get ('HBSOURCES', '').split ()] or \
HBSOURCES = [os.path.basename (x) for x in os.getenv ('HBSOURCES', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))]
stat = 0

@ -2,9 +2,9 @@
import sys, os, shutil, subprocess
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
libs = os.environ.get ('libs', '.libs')
libs = os.getenv ('libs', '.libs')
ldd = shutil.which ('ldd')
if ldd:

@ -2,8 +2,8 @@
import sys, os, shutil, subprocess, glob, re
builddir = os.environ.get ('builddir', os.path.dirname (__file__))
libs = os.environ.get ('libs', '.libs')
builddir = os.getenv ('builddir', os.path.dirname (__file__))
libs = os.getenv ('libs', '.libs')
objdump = shutil.which ('objdump')
if not objdump:

@ -4,8 +4,8 @@ import sys, os, shutil, subprocess, re, difflib
os.environ['LC_ALL'] = 'C' # otherwise 'nm' prints in wrong order
builddir = os.environ.get ('builddir', os.path.dirname (__file__))
libs = os.environ.get ('libs', '.libs')
builddir = os.getenv ('builddir', os.path.dirname (__file__))
libs = os.getenv ('libs', '.libs')
IGNORED_SYMBOLS = '|'.join(['_fini', '_init', '_fdata', '_ftext', '_fbss',
'__bss_start', '__bss_start__', '__bss_end__', '_edata', '_end', '_bss_end__',

@ -41,7 +41,7 @@ hb_font_get_var_coords_design""".splitlines ()
symbols = [x for x in symbols if x not in experimental_symbols]
symbols = "\n".join (symbols)
result = symbols if os.environ.get('PLAIN_LIST', '') else """EXPORTS
result = symbols if os.getenv ('PLAIN_LIST', '') else """EXPORTS
%s
LIBRARY lib%s-0.dll""" % (symbols, output_file.replace ('src/', '').replace ('.def', ''))

@ -9,7 +9,7 @@ def cmd (command):
p = subprocess.Popen (command, stderr=tempf)
try:
p.wait (timeout=int (os.environ.get ("HB_TEST_SHAPE_FUZZER_TIMEOUT", "2")))
p.wait (timeout=int (os.getenv ("HB_TEST_SHAPE_FUZZER_TIMEOUT", "2")))
tempf.seek (0)
text = tempf.read ()
@ -21,9 +21,9 @@ def cmd (command):
return 'error: timeout, ' + ' '.join (command), 1
srcdir = os.environ.get ("srcdir", ".")
EXEEXT = os.environ.get ("EXEEXT", "")
top_builddir = os.environ.get ("top_builddir", ".")
srcdir = os.getenv ("srcdir", ".")
EXEEXT = os.getenv ("EXEEXT", "")
top_builddir = os.getenv ("top_builddir", ".")
hb_draw_fuzzer = os.path.join (top_builddir, "hb-draw-fuzzer" + EXEEXT)
if not os.path.exists (hb_draw_fuzzer):
@ -36,9 +36,9 @@ please provide it as the first argument to the tool""")
print ('hb_draw_fuzzer:', hb_draw_fuzzer)
fails = 0
libtool = os.environ.get ('LIBTOOL')
libtool = os.getenv ('LIBTOOL')
valgrind = None
if os.environ.get ('RUN_VALGRIND', ''):
if os.getenv ('RUN_VALGRIND', ''):
valgrind = shutil.which ('valgrind')
if valgrind is None:
sys.exit ("""Valgrind requested but not found.""")

@ -9,7 +9,7 @@ def cmd (command):
p = subprocess.Popen (command, stderr=tempf)
try:
p.wait (timeout=int (os.environ.get ("HB_TEST_SHAPE_FUZZER_TIMEOUT", "2")))
p.wait (timeout=int (os.getenv ("HB_TEST_SHAPE_FUZZER_TIMEOUT", "2")))
tempf.seek (0)
text = tempf.read ()
@ -21,9 +21,9 @@ def cmd (command):
return 'error: timeout, ' + ' '.join (command), 1
srcdir = os.environ.get ("srcdir", ".")
EXEEXT = os.environ.get ("EXEEXT", "")
top_builddir = os.environ.get ("top_builddir", ".")
srcdir = os.getenv ("srcdir", ".")
EXEEXT = os.getenv ("EXEEXT", "")
top_builddir = os.getenv ("top_builddir", ".")
hb_shape_fuzzer = os.path.join (top_builddir, "hb-shape-fuzzer" + EXEEXT)
if not os.path.exists (hb_shape_fuzzer):
@ -36,9 +36,9 @@ please provide it as the first argument to the tool""")
print ('hb_shape_fuzzer:', hb_shape_fuzzer)
fails = 0
libtool = os.environ.get ('LIBTOOL')
libtool = os.getenv ('LIBTOOL')
valgrind = None
if os.environ.get ('RUN_VALGRIND', ''):
if os.getenv ('RUN_VALGRIND', ''):
valgrind = shutil.which ('valgrind')
if valgrind is None:
sys.exit ("""Valgrind requested but not found.""")

@ -9,7 +9,7 @@ def cmd (command):
p = subprocess.Popen (command, stderr=tempf)
try:
p.wait (timeout=int (os.environ.get ("HB_TEST_SUBSET_FUZZER_TIMEOUT", "12")))
p.wait (timeout=int (os.getenv ("HB_TEST_SUBSET_FUZZER_TIMEOUT", "12")))
tempf.seek (0)
text = tempf.read ()
@ -21,9 +21,9 @@ def cmd (command):
return 'error: timeout, ' + ' '.join (command), 1
srcdir = os.environ.get ("srcdir", ".")
EXEEXT = os.environ.get ("EXEEXT", "")
top_builddir = os.environ.get ("top_builddir", ".")
srcdir = os.getenv ("srcdir", ".")
EXEEXT = os.getenv ("EXEEXT", "")
top_builddir = os.getenv ("top_builddir", ".")
hb_subset_fuzzer = os.path.join (top_builddir, "hb-subset-fuzzer" + EXEEXT)
if not os.path.exists (hb_subset_fuzzer):
@ -36,9 +36,9 @@ please provide it as the first argument to the tool""")
print ('hb_subset_fuzzer:', hb_subset_fuzzer)
fails = 0
libtool = os.environ.get('LIBTOOL')
libtool = os.getenv ('LIBTOOL')
valgrind = None
if os.environ.get('RUN_VALGRIND', ''):
if os.getenv ('RUN_VALGRIND', ''):
valgrind = shutil.which ('valgrind')
if valgrind is None:
sys.exit ("""Valgrind requested but not found.""")

@ -2,7 +2,7 @@
import sys, os, subprocess, shutil
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
git = shutil.which ('git'); assert git
make = shutil.which ('make'); assert make

@ -63,7 +63,7 @@ def extract_tests (input):
assert found
return '\n'.join (result) + '\n'
os.chdir (os.environ.get ('srcdir', os.path.dirname (__file__)))
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
git = shutil.which ('git')
assert git

@ -4,8 +4,8 @@ import os, subprocess
from pathlib import Path
outfile = Path(
os.getenv('MESON_DIST_ROOT')
or os.getenv('MESON_SOURCE_ROOT')
os.getenv ('MESON_DIST_ROOT')
or os.getenv ('MESON_SOURCE_ROOT')
or Path(__file__).parent
) / '.tarball-revision'

Loading…
Cancel
Save