mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
update: allow patch parsing to work with python 2
If we want to be able to read in patch information on python2-based branches (e.g. fido) then we need to use codecs.open() instead of open() here since python2's open() did not support the encoding parameter. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
11a1d0859d
commit
8bb62fb82d
|
@ -17,6 +17,7 @@ import re
|
|||
import tempfile
|
||||
import shutil
|
||||
import errno
|
||||
import codecs
|
||||
from distutils.version import LooseVersion
|
||||
import itertools
|
||||
import utils
|
||||
|
@ -77,7 +78,7 @@ def collect_patch(recipe, patchfn, layerdir_start, stop_on_error):
|
|||
try:
|
||||
for encoding in ['utf-8', 'latin-1']:
|
||||
try:
|
||||
with open(patchfn, 'r', encoding=encoding) as f:
|
||||
with codecs.open(patchfn, 'r', encoding=encoding) as f:
|
||||
for line in f:
|
||||
line = line.rstrip()
|
||||
if line.startswith('Index: ') or line.startswith('diff -') or line.startswith('+++ '):
|
||||
|
|
Loading…
Reference in New Issue
Block a user