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

Skip to content

Commit 8758df3

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.x'
Conflicts: lib/matplotlib/backends/web_backend/js/mpl.js - indentation conflicts lib/matplotlib/backends/web_backend/nbagg_mpl.js - deleted on the master branch (not resurrected) lib/matplotlib/testing/decorators.py - import conflicts
2 parents 00e6c38 + 0bf79ea commit 8758df3

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,10 +3643,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
36433643

36443644
def to_vc(xs, ys):
36453645
# convert arguments to verts and codes
3646-
verts = []
3647-
3648-
for xi, yi in zip(xs, ys):
3649-
verts.append((xi, yi))
3646+
verts = list(zip(xs, ys))
36503647
verts.append((0, 0)) # ignored
36513648
codes = [mpath.Path.MOVETO] + \
36523649
[mpath.Path.LINETO] * (len(verts) - 2) + \

lib/matplotlib/backends/web_backend/js/mpl.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ mpl.figure.prototype._init_canvas = function() {
145145
this.context = canvas[0].getContext("2d");
146146

147147
var backingStore = this.context.backingStorePixelRatio ||
148-
this.context.webkitBackingStorePixelRatio ||
149-
this.context.mozBackingStorePixelRatio ||
150-
this.context.msBackingStorePixelRatio ||
151-
this.context.oBackingStorePixelRatio ||
152-
this.context.backingStorePixelRatio || 1;
148+
this.context.webkitBackingStorePixelRatio ||
149+
this.context.mozBackingStorePixelRatio ||
150+
this.context.msBackingStorePixelRatio ||
151+
this.context.oBackingStorePixelRatio ||
152+
this.context.backingStorePixelRatio || 1;
153153

154154
mpl.ratio = (window.devicePixelRatio || 1) / backingStore;
155155

lib/matplotlib/testing/decorators.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# allows other functions here to be used by pytest-based testing suites without
1616
# requiring nose to be installed.
1717

18+
1819
import matplotlib as mpl
1920
import matplotlib.style
2021
import matplotlib.units
@@ -404,6 +405,9 @@ def find_dotted_module(module_name, path=None):
404405

405406

406407
def switch_backend(backend):
408+
# Local import to avoid a hard nose dependency and only incur the
409+
# import time overhead at actual test-time.
410+
import nose
407411
def switch_backend_decorator(func):
408412
def backend_switcher(*args, **kwargs):
409413
try:

lib/matplotlib/type1font.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ def suppress(tokens):
306306
b'/FontMatrix': replace(fontmatrix),
307307
b'/UniqueID': suppress}
308308

309-
while True:
310-
token, value = next(tokens)
309+
for token, value in tokens:
311310
if token is cls._name and value in table:
312311
for value in table[value](itertools.chain([(token, value)],
313312
tokens)):

setupext.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,19 +1139,34 @@ def do_custom_build(self):
11391139
pass
11401140

11411141
if not os.path.isfile(tarball_path):
1142-
url_fmt = (
1143-
'http://download.savannah.gnu.org/releases/freetype/{0}')
1144-
tarball_url = url_fmt.format(tarball)
11451142

1146-
print("Downloading {0}".format(tarball_url))
11471143
if sys.version_info[0] == 2:
11481144
from urllib import urlretrieve
11491145
else:
11501146
from urllib.request import urlretrieve
1151-
11521147
if not os.path.exists('build'):
11531148
os.makedirs('build')
1154-
urlretrieve(tarball_url, tarball_path)
1149+
1150+
sourceforge_url = (
1151+
'http://downloads.sourceforge.net/project/freetype'
1152+
'/freetype2/{0}/'.format(LOCAL_FREETYPE_VERSION)
1153+
)
1154+
url_fmts = (
1155+
sourceforge_url + '{0}',
1156+
'http://download.savannah.gnu.org/releases/freetype/{0}'
1157+
)
1158+
for url_fmt in url_fmts:
1159+
tarball_url = url_fmt.format(tarball)
1160+
1161+
print("Downloading {0}".format(tarball_url))
1162+
try:
1163+
urlretrieve(tarball_url, tarball_path)
1164+
except:
1165+
print("Failed to download {0}".format(tarball_url))
1166+
else:
1167+
break
1168+
if not os.path.isfile(tarball_path):
1169+
raise IOError("Failed to download freetype")
11551170
if get_file_hash(tarball_path) == LOCAL_FREETYPE_HASH:
11561171
try:
11571172
# this will fail on LPy, oh well

0 commit comments

Comments
 (0)