Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a52521

Browse files
authored
Merge pull request #15448 from tacaswell/v22x_py38_compat
V22x py38 compat
2 parents 126e13b + c864b7b commit 4a52521

File tree

17 files changed

+80
-72
lines changed

17 files changed

+80
-72
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def paintEvent(self, e):
6868
if hasattr(qimage, 'setDevicePixelRatio'):
6969
# Not available on Qt4 or some older Qt5.
7070
qimage.setDevicePixelRatio(self._dpi_ratio)
71-
origin = QtCore.QPoint(l, self.renderer.height - t)
71+
origin = QtCore.QPoint(int(l), int(self.renderer.height - t))
7272
painter.drawImage(origin / self._dpi_ratio, qimage)
7373

7474
self._draw_rect_callback(painter)

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def apply_callback(data):
222222
rgba = mcolors.to_rgba(color)
223223
line.set_alpha(None)
224224
line.set_color(rgba)
225-
if marker is not 'none':
225+
if marker != 'none':
226226
line.set_marker(marker)
227227
line.set_markersize(markersize)
228228
line.set_markerfacecolor(markerfacecolor)

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ def __init__(self, ax, *args, **kwargs):
870870
self.logscale = True
871871
if norm is None:
872872
norm = colors.LogNorm()
873-
if self.extend is not 'neither':
873+
if self.extend != 'neither':
874874
raise ValueError('extend kwarg does not work yet with log '
875875
' scale')
876876
else:

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343
The font directory code is from ttfquery,
4444
see license/LICENSE_TTFQUERY.
4545
"""
46-
47-
from collections import Iterable
46+
try:
47+
from collections.abc import Iterable
48+
except ImportError:
49+
from collections import Iterable
4850
import json
4951
import os
5052
import sys

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@ def matshow(A, fignum=None, **kwargs):
24192419
24202420
"""
24212421
A = np.asanyarray(A)
2422-
if fignum is False or fignum is 0:
2422+
if fignum is False or fignum == 0:
24232423
ax = gca()
24242424
else:
24252425
# Extract actual aspect ratio of array and make appropriately sized figure

src/_macosx.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define PY_SSIZE_T_CLEAN
12
#include <Cocoa/Cocoa.h>
23
#include <ApplicationServices/ApplicationServices.h>
34
#include <sys/socket.h>

src/_png.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
66
of harmless warnings.
77
*/
8-
8+
#define PY_SSIZE_T_CLEAN
99

1010
extern "C" {
1111
# include <png.h>

src/_tkagg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* See LICENSE/LICENSE.PIL for details.
88
*
99
*/
10-
10+
#define PY_SSIZE_T_CLEAN
1111
#include <Python.h>
1212
#include <cstdlib>
1313
#include <cstdio>

src/_ttconv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Python wrapper for TrueType conversion library in ../ttconv.
77
*/
8-
8+
#define PY_SSIZE_T_CLEAN
99
#include "mplutils.h"
1010

1111
#include <Python.h>

src/file_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef __FILE_COMPAT_H__
22
#define __FILE_COMPAT_H__
3-
3+
#define PY_SSIZE_T_CLEAN
44
#include <Python.h>
55
#include <stdio.h>
66
#include "numpy/npy_common.h"

0 commit comments

Comments
 (0)