Skip to content

Commit 1c499d9

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
2 parents 3f2944f + 567befa commit 1c499d9

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
155155

156156
xd = descent * np.sin(np.deg2rad(angle))
157157
yd = descent * np.cos(np.deg2rad(angle))
158-
x = np.round(x + ox - xd)
158+
x = np.round(x + ox + xd)
159159
y = np.round(y - oy + yd)
160160
self._renderer.draw_text_image(font_image, x, y + 1, angle, gc)
161161

lib/matplotlib/cbook.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,10 @@ def pieces(seq, num=2):
11731173

11741174

11751175
def exception_to_str(s=None):
1176-
1177-
sh = io.StringIO()
1176+
if sys.version_info[0] < 3:
1177+
sh = io.BytesIO()
1178+
else:
1179+
sh = io.StringIO()
11781180
if s is not None:
11791181
print(s, file=sh)
11801182
traceback.print_exc(file=sh)

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
import sys
44

55
from nose.tools import assert_equal
6-
import pep8
6+
from nose.plugins.skip import SkipTest
7+
8+
try:
9+
import pep8
10+
except ImportError:
11+
HAS_PEP8 = False
12+
else:
13+
HAS_PEP8 = True
714

815
import matplotlib
916

@@ -172,6 +179,9 @@ def _test_pep8_conformance():
172179
# The file should be a line separated list of filenames/directories
173180
# as can be passed to the "pep8" tool's exclude list.
174181

182+
if not HAS_PEP8:
183+
raise SkipTest('The pep8 tool is required for this test')
184+
175185
# Only run this test with Python 2 - the 2to3 tool generates non pep8
176186
# compliant code.
177187
if sys.version_info[0] != 2:

src/_tkagg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ _pyobj_addr(PyObject* self, PyObject* args)
219219
{
220220
return NULL;
221221
}
222-
return Py_BuildValue("l", (long) pyobj);
222+
return Py_BuildValue("n", (Py_ssize_t) pyobj);
223223
}
224224

225225
static PyObject*
@@ -228,9 +228,9 @@ _tkinit(PyObject* self, PyObject* args)
228228
Tcl_Interp* interp;
229229
TkappObject* app;
230230

231-
long arg;
231+
Py_ssize_t arg;
232232
int is_interp;
233-
if (!PyArg_ParseTuple(args, "li", &arg, &is_interp))
233+
if (!PyArg_ParseTuple(args, "ni", &arg, &is_interp))
234234
{
235235
return NULL;
236236
}

0 commit comments

Comments
 (0)