Apply Python 3 futurize transform libmodernize.fixes.fix_map

Refer to #256
This commit is contained in:
Eklavya Sharma 2016-03-10 23:09:37 +05:30 committed by Tim Abbott
parent 7b8cb105bf
commit aa505b0d55
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import os
import sys
import subprocess
from six.moves import filter
from six.moves import map
class Record:
pass
@ -164,7 +165,7 @@ def get_html_tag(text, i):
return s
def check_our_files():
git_files = map(str.strip, subprocess.check_output(['git', 'ls-files']).split('\n'))
git_files = list(map(str.strip, subprocess.check_output(['git', 'ls-files']).split('\n')))
# Check all our handlebars templates.
templates = [fn for fn in git_files if fn.endswith('.handlebars')]

View File

@ -11,6 +11,7 @@ import traceback
from os import path
from collections import defaultdict
from six.moves import filter
from six.moves import map
parser = optparse.OptionParser()
parser.add_option('--full',
@ -46,7 +47,7 @@ api/integrations/perforce/git_p4.py
if options.modified:
# If the user specifies, use `git ls-files -m` to only check modified, non-staged
# files in the current checkout. This makes things fun faster.
files = map(str.strip, subprocess.check_output(['git', 'ls-files', '-m']).split('\n'))
files = list(map(str.strip, subprocess.check_output(['git', 'ls-files', '-m']).split('\n')))
else:
files = []
@ -54,7 +55,7 @@ files += args
if not files and not options.modified:
# If no files are specified on the command line, use the entire git checkout
files = map(str.strip, subprocess.check_output(['git', 'ls-files']).split('\n'))
files = list(map(str.strip, subprocess.check_output(['git', 'ls-files']).split('\n')))
files = list(filter(bool, files)) # remove empty file caused by trailing \n