Skip to content

Commit

Permalink
Update Python2 syntax to Python3 syntax in ghwt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer-coding authored and jpakkane committed Dec 6, 2019
1 parent 4487c66 commit c0a9bca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ghwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def list_projects():
return 0

def unpack(sproj, branch, outdir):
subprocess.check_call(['git', 'clone', '-b', branch, 'https://github.com/mesonbuild/%s.git' % sproj, outdir])
subprocess.check_call(['git', 'clone', '-b', branch, 'https://github.com/mesonbuild/{}.git'.format(sproj), outdir])
usfile = os.path.join(outdir, 'upstream.wrap')
assert(os.path.isfile(usfile))
config = configparser.ConfigParser()
Expand Down Expand Up @@ -82,7 +82,7 @@ def install(sproj):
if os.path.isdir(sproj_dir):
print('Subproject is already there. To update, nuke the dir and reinstall.')
return 1
blist = gh_get('https://api.github.com/repos/mesonbuild/%s/branches' % sproj)
blist = gh_get('https://api.github.com/repos/mesonbuild/{}/branches'.format(sproj))
blist = [b['name'] for b in blist]
blist = [b for b in blist if b != 'master']
blist.sort()
Expand Down
10 changes: 5 additions & 5 deletions tools/ac_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

help_message = """Usage: %s <config.h.meson>
help_message = """Usage: {} <config.h.meson>
This script reads config.h.meson, looks for header
checks and writes the corresponding meson declaration.
Expand Down Expand Up @@ -368,7 +368,7 @@
sizes = []

if len(sys.argv) != 2:
print(help_message % sys.argv[0])
print(help_message.format(sys.argv[0]))
sys.exit(0)

with open(sys.argv[1]) as f:
Expand Down Expand Up @@ -414,7 +414,7 @@

print('check_headers = [')
for token, hname in headers:
print(" ['%s', '%s']," % (token, hname))
print(" ['{}', '{}'],".format(token, hname))
print(']\n')

print('''foreach h : check_headers
Expand All @@ -430,7 +430,7 @@
for tok in functions:
if len(tok) == 3:
tokstr, fdata0, fdata1 = tok
print(" ['%s', '%s', '#include<%s>']," % (tokstr, fdata0, fdata1))
print(" ['{}', '{}', '#include<{}>'],".format(tokstr, fdata0, fdata1))
else:
print('# check token', tok)
print(']\n')
Expand All @@ -445,7 +445,7 @@
# Convert sizeof checks.

for elem, typename in sizes:
print("cdata.set('%s', cc.sizeof('%s'))" % (elem, typename))
print("cdata.set('{}', cc.sizeof('{}'))".format(elem, typename))

print('''
configure_file(input : 'config.h.meson',
Expand Down

0 comments on commit c0a9bca

Please sign in to comment.