Explicitly using python2 to prevent errors on py3-default systems

This commit is contained in:
Jacob Henner 2017-03-11 11:52:17 -05:00 committed by John Maguire
parent 6c9bc43bbb
commit e7ec942256
8 changed files with 21 additions and 19 deletions

View File

@ -1,4 +1,4 @@
add_custom_target(format-diff
COMMAND python ${CMAKE_SOURCE_DIR}/dist/format.py)
COMMAND python2 ${CMAKE_SOURCE_DIR}/dist/format.py)
add_custom_target(format
COMMAND python ${CMAKE_SOURCE_DIR}/dist/format.py -i)
COMMAND python2 ${CMAKE_SOURCE_DIR}/dist/format.py -i)

2
dist/codesign.py vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
# Emulates the behaviour of codesign --deep which is missing on OS X < 10.9
import os

24
dist/copyright.py vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
from subprocess import *
from sys import *
@ -6,7 +6,7 @@ from os import rename, remove
from datetime import *
def pretty_years(s):
l = list(s)
l.sort()
@ -23,7 +23,7 @@ def pretty_years(s):
if x == prev + 1:
prev = x
continue
if prev == start:
r.append("%i" % prev)
else:
@ -41,10 +41,10 @@ def pretty_years(s):
return ", ".join(r)
def order_by_year(a, b):
la = list(a[2])
la.sort()
lb = list(b[2])
lb.sort()
@ -60,9 +60,9 @@ def gen_copyrights(f):
commits = []
data = {}
copyrights = []
for ln in Popen(["git", "blame", "--incremental", f], stdout=PIPE).stdout:
if ln.startswith("filename "):
if len(data) > 0:
commits.append(data)
@ -110,7 +110,7 @@ def gen_copyrights(f):
if a[1] == b[1]:
a[2].update(b[2])
if by_author.has_key(an) and by_author.has_key(bn):
if by_author.has_key(an) and by_author.has_key(bn):
del by_author[bn]
copyright = list(by_author.itervalues())
@ -129,7 +129,7 @@ def change_file(filename):
content=fi.readlines()
copyrights=gen_copyrights(filename)
if -1 == content[0].find("/* This file is part of Clementine."):
print("File {} have no Clementine copyright info".format(filename))
return 0
@ -141,16 +141,16 @@ def change_file(filename):
if not extended:
out.extend(copyrights)
extended = 1
if not ends:
continue
else:
out.append(i)
with open(filename+'_tmp', "w") as fi:
fi.writelines(out)
rename(filename+'_tmp', filename)
if __name__ == "__main__":
for files in argv[1:]:

4
dist/cpplint.py vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
@ -4646,7 +4646,7 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
# Make Windows paths like Unix.
fullname = os.path.abspath(filename).replace('\\', '/')
# Perform other checks now that we are sure that this is not an include line
CheckCasts(filename, clean_lines, linenum, error)
CheckGlobalStatic(filename, clean_lines, linenum, error)

2
dist/format.py vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import argparse
import difflib
import os

2
dist/macdeploy.py vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
# This file is part of Clementine.
#

View File

@ -1,3 +1,4 @@
#!/usr/bin/python2
import codecs
import glob
import logging

View File

@ -1,3 +1,4 @@
#!/usr/bin/python2
import rpm
import subprocess