summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2014-02-22 18:41:19 -0500
committerColin Walters <walters@verbum.org>2014-02-22 18:41:19 -0500
commit5bc75e64e76dc0ab96edfd3b22a8af2b8a671920 (patch)
tree16407abe6c836cdc2d3327ea056de46146afc016
parent160e995a63fc54dbbfb3131ff23b0327077608ec (diff)
downloadgobject-introspection-5bc75e64e76dc0ab96edfd3b22a8af2b8a671920.tar.gz
Fix some PEP8 errors from previous commits
-rw-r--r--giscanner/dumper.py5
-rw-r--r--giscanner/utils.py5
2 files changed, 7 insertions, 3 deletions
diff --git a/giscanner/dumper.py b/giscanner/dumper.py
index ea3fe688..85e8a2a2 100644
--- a/giscanner/dumper.py
+++ b/giscanner/dumper.py
@@ -302,11 +302,12 @@ class DumpCompiler(object):
# runs the command we want
tf, tf_name = tempfile.mkstemp()
f = os.fdopen(tf, 'wb')
- fcontents = '#!/bin/sh\nunset PWD\n{}\n'.format(' '.join ([x.replace ('\\','/') for x in args]))
+ shellcontents = ' '.join([x.replace('\\', '/') for x in args])
+ fcontents = '#!/bin/sh\nunset PWD\n{}\n'.format(shellcontents)
f.write(fcontents)
f.close()
shell = utils.which(shell)
- args = [shell, tf_name.replace('\\','/')]
+ args = [shell, tf_name.replace('\\', '/')]
try:
subprocess.check_call(args)
except subprocess.CalledProcessError as e:
diff --git a/giscanner/utils.py b/giscanner/utils.py
index b1fdcb46..537109cd 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -183,12 +183,15 @@ def cflag_real_include_path(cflag):
return "-I" + os.path.realpath(cflag[2:])
+
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
def is_nt_exe(fpath):
- return not fpath.lower().endswith('.exe') and os.path.isfile(fpath + '.exe') and os.access(fpath + '.exe', os.X_OK)
+ return not fpath.lower().endswith('.exe') and \
+ os.path.isfile(fpath + '.exe') and \
+ os.access(fpath + '.exe', os.X_OK)
fpath, fname = os.path.split(program)
if fpath: