mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
patchutils.py: Fix compatibility of StringIO with Python 3.
This commit is contained in:
parent
d3a4c072f7
commit
8571c8b533
@ -19,7 +19,6 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#
|
||||
|
||||
import cStringIO as StringIO
|
||||
import collections
|
||||
import difflib
|
||||
import email.header
|
||||
@ -31,6 +30,11 @@ import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
_devnull = open(os.devnull, 'wb')
|
||||
|
||||
class PatchParserError(RuntimeError):
|
||||
@ -95,7 +99,7 @@ class _FileReader(object):
|
||||
self.peeked = None
|
||||
|
||||
if content is not None:
|
||||
self.fp = StringIO.StringIO(content)
|
||||
self.fp = StringIO(content)
|
||||
else:
|
||||
self.fp = open(filename)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user