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

Skip to content

Commit f8f8244

Browse files
committed
Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.x
Conflicts: lib/matplotlib/lines.py keep the _dashoffset = 0 line setupext.py use the version from 1.5.x
2 parents fe382f5 + a1ada7a commit f8f8244

3 files changed

Lines changed: 34 additions & 17 deletions

File tree

lib/matplotlib/patches.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4051,7 +4051,7 @@ def __init__(self, posA=None, posB=None,
40514051
def set_dpi_cor(self, dpi_cor):
40524052
"""
40534053
dpi_cor is currently used for linewidth-related things and
4054-
shink factor. Mutation scale is not affected by this.
4054+
shrink factor. Mutation scale is not affected by this.
40554055
"""
40564056

40574057
self._dpi_cor = dpi_cor
@@ -4060,14 +4060,14 @@ def set_dpi_cor(self, dpi_cor):
40604060
def get_dpi_cor(self):
40614061
"""
40624062
dpi_cor is currently used for linewidth-related things and
4063-
shink factor. Mutation scale is not affected by this.
4063+
shrink factor. Mutation scale is not affected by this.
40644064
"""
40654065

40664066
return self._dpi_cor
40674067

40684068
def set_positions(self, posA, posB):
4069-
""" set the begin end end positions of the connecting
4070-
path. Use current vlaue if None.
4069+
""" set the begin and end positions of the connecting
4070+
path. Use current value if None.
40714071
"""
40724072
if posA is not None:
40734073
self._posA_posB[0] = posA

lib/matplotlib/testing/decorators.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,20 @@ def _image_directories(func):
359359
# namespace package pip installed and run via the nose
360360
# multiprocess plugin or as a specific test this may be
361361
# missing. See https://github.com/matplotlib/matplotlib/issues/3314
362-
assert mods.pop(0) == 'tests'
362+
if mods.pop(0) != 'tests':
363+
warnings.warn(("Module '%s' does not live in a parent module "
364+
"named 'tests'. This is probably ok, but we may not be able "
365+
"to guess the correct subdirectory containing the baseline "
366+
"images. If things go wrong please make sure that there is "
367+
"a parent directory named 'tests' and that it contains a "
368+
"__init__.py file (can be empty).") % module_name)
363369
subdir = os.path.join(*mods)
364370

365371
import imp
366372
def find_dotted_module(module_name, path=None):
367-
"""A version of imp which can handle dots in the module name"""
373+
"""A version of imp which can handle dots in the module name.
374+
As for imp.find_module(), the return value is a 3-element
375+
tuple (file, pathname, description)."""
368376
res = None
369377
for sub_mod in module_name.split('.'):
370378
try:

setupext.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import versioneer
1818

1919

20-
PY3 = (sys.version_info[0] >= 3)
20+
PY3min = (sys.version_info[0] >= 3)
21+
PY32min = (PY3min and sys.version_info[1] >= 2 or sys.version_info[0] > 3)
2122

2223

2324
# This is the version of FreeType to use when building a local
@@ -28,13 +29,13 @@
2829
LOCAL_FREETYPE_HASH = '348e667d728c597360e4a87c16556597'
2930

3031
if sys.platform != 'win32':
31-
if sys.version_info[0] < 3:
32+
if not PY3min:
3233
from commands import getstatusoutput
3334
else:
3435
from subprocess import getstatusoutput
3536

3637

37-
if PY3:
38+
if PY3min:
3839
import configparser
3940
else:
4041
import ConfigParser as configparser
@@ -51,7 +52,10 @@
5152

5253
setup_cfg = os.environ.get('MPLSETUPCFG', 'setup.cfg')
5354
if os.path.exists(setup_cfg):
54-
config = configparser.SafeConfigParser()
55+
if PY32min:
56+
config = configparser.ConfigParser()
57+
else:
58+
config = configparser.SafeConfigParser()
5559
config.read(setup_cfg)
5660

5761
if config.has_option('status', 'suppress'):
@@ -483,12 +487,17 @@ class OptionalPackage(SetupPackage):
483487
def get_config(cls):
484488
"""
485489
Look at `setup.cfg` and return one of ["auto", True, False] indicating
486-
if the package is at default state ("auto"), forced by the user (True)
487-
or opted-out (False).
490+
if the package is at default state ("auto"), forced by the user (case
491+
insensitively defined as 1, true, yes, on for True) or opted-out (case
492+
insensitively defined as 0, false, no, off for False).
488493
"""
494+
conf = "auto"
489495
if config is not None and config.has_option(cls.config_category, cls.name):
490-
return config.get(cls.config_category, cls.name)
491-
return "auto"
496+
try:
497+
conf = config.getboolean(cls.config_category, cls.name)
498+
except ValueError:
499+
conf = config.get(cls.config_category, cls.name)
500+
return conf
492501

493502
def check(self):
494503
"""
@@ -1376,7 +1385,7 @@ def __init__(self):
13761385

13771386
def check_requirements(self):
13781387
try:
1379-
if PY3:
1388+
if PY3min:
13801389
import tkinter as Tkinter
13811390
else:
13821391
import Tkinter
@@ -1427,7 +1436,7 @@ def query_tcltk(self):
14271436
return self.tcl_tk_cache
14281437

14291438
# By this point, we already know that Tkinter imports correctly
1430-
if PY3:
1439+
if PY3min:
14311440
import tkinter as Tkinter
14321441
else:
14331442
import Tkinter
@@ -1468,7 +1477,7 @@ def query_tcltk(self):
14681477

14691478
def parse_tcl_config(self, tcl_lib_dir, tk_lib_dir):
14701479
try:
1471-
if PY3:
1480+
if PY3min:
14721481
import tkinter as Tkinter
14731482
else:
14741483
import Tkinter

0 commit comments

Comments
 (0)