Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 04b8314

Browse filesBrowse files
committed
Merge pull request #2393 from davidovitch/use_stringIO_from_six
use six.move for cStringIO
2 parents 8a3a4df + 0b3b410 commit 04b8314
Copy full SHA for 04b8314

File tree

2 files changed

+4
-10
lines changed
Filter options

2 files changed

+4
-10
lines changed

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ def write(self, *kl, **kwargs):
10831083

10841084
self._pswriter = NullWriter()
10851085
else:
1086-
self._pswriter = io.StringIO()
1086+
self._pswriter = six.moves.cStringIO()
10871087

10881088

10891089
# mixed mode rendering
@@ -1245,10 +1245,7 @@ def write(self, *kl, **kwargs):
12451245

12461246
self._pswriter = NullWriter()
12471247
else:
1248-
if six.PY3:
1249-
self._pswriter = io.StringIO()
1250-
else:
1251-
self._pswriter = cStringIO.StringIO()
1248+
self._pswriter = six.moves.cStringIO()
12521249

12531250

12541251
# mixed mode rendering

‎lib/matplotlib/mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/mathtext.py
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323

2424
import os, sys
2525
if six.PY3:
26-
from io import StringIO
2726
unichr = chr
28-
else:
29-
from cStringIO import StringIO
3027
from math import ceil
3128
try:
3229
set
@@ -245,7 +242,7 @@ class MathtextBackendPs(MathtextBackend):
245242
backend.
246243
"""
247244
def __init__(self):
248-
self.pswriter = StringIO()
245+
self.pswriter = six.moves.cStringIO()
249246
self.lastfont = None
250247

251248
def render_glyph(self, ox, oy, info):
@@ -1052,7 +1049,7 @@ def __init__(self, default_font_prop):
10521049

10531050
self.fonts['default'] = default_font
10541051
self.fonts['regular'] = default_font
1055-
self.pswriter = StringIO()
1052+
self.pswriter = six.moves.cStringIO()
10561053

10571054
def _get_font(self, font):
10581055
if font in self.fontmap:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.