mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 23:54:17 +00:00
Update this to deal with Marc and Bruno's names
Strings are hard, let's introduce hacks.
This commit is contained in:
parent
98dbd1606a
commit
ca882263f8
1 changed files with 5 additions and 2 deletions
|
|
@ -47,7 +47,7 @@ def git_patch_to_hg(fin, fout):
|
||||||
# NOTE: there will still be an index line after each diff --git, but it
|
# NOTE: there will still be an index line after each diff --git, but it
|
||||||
# will be ignored
|
# will be ignored
|
||||||
for line in fin:
|
for line in fin:
|
||||||
fout.write(line)
|
fout.write(line.encode('utf-8'))
|
||||||
|
|
||||||
# NOTE: the --/version will still be at the end, but it will be ignored
|
# NOTE: the --/version will still be at the end, but it will be ignored
|
||||||
|
|
||||||
|
|
@ -58,7 +58,10 @@ def open_file():
|
||||||
import requests
|
import requests
|
||||||
import io
|
import io
|
||||||
resp = requests.get(sys.argv[1])
|
resp = requests.get(sys.argv[1])
|
||||||
return io.StringIO(resp.content) if resp.ok else io.StringIO('')
|
if resp.ok:
|
||||||
|
return io.StringIO(resp.content.decode('utf-8'))
|
||||||
|
else:
|
||||||
|
return io.StringIO('')
|
||||||
elif os.path.exists(sys.argv[1]):
|
elif os.path.exists(sys.argv[1]):
|
||||||
return open(sys.argv[1])
|
return open(sys.argv[1])
|
||||||
return sys.stdin
|
return sys.stdin
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue