| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b90e18b commit 654e1fd
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -130,7 +130,7 @@ | |||
| 130 | 130 | ||
| 131 | 131 | import sys, os, tempfile | |
| 132 | 132 | ||
| 133 | - if sys.hexversion >= 0x03000000: | ||
| 133 | + if sys.version_info[0] >= 3: | ||
| 134 | 134 | def ascii(s): return bytes(s, 'ascii') | |
| 135 | 135 | else: | |
| 136 | 136 | ascii = str | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | from __future__ import division, generators | |
| 2 | + from matplotlib import IS_PY3K | ||
| 2 | 3 | import math, sys, warnings, datetime | |
| 3 | 4 | from operator import itemgetter | |
| 4 | 5 | import itertools | |
@@ -8468,7 +8469,7 @@ def subplot_class_factory(axes_class=None): | |||
| 8468 | 8469 | ||
| 8469 | 8470 | new_class = _subplot_classes.get(axes_class) | |
| 8470 | 8471 | if new_class is None: | |
| 8471 | - if sys.hexversion >= 0x03000000: | ||
| 8472 | + if IS_PY3K: | ||
| 8472 | 8473 | new_class = type("%sSubplot" % (axes_class.__name__), | |
| 8473 | 8474 | (SubplotBase, axes_class), | |
| 8474 | 8475 | {'_axes_class': axes_class}) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ | |||
| 13 | 13 | import os.path | |
| 14 | 14 | import random | |
| 15 | 15 | import urllib2 | |
| 16 | - if sys.hexversion > 0x03000000: | ||
| 16 | + if sys.version_info[0] >= 3: | ||
| 17 | 17 | import types | |
| 18 | 18 | else: | |
| 19 | 19 | import new | |
@@ -186,7 +186,7 @@ def __call__(self, *args, **kwargs): | |||
| 186 | 186 | raise ReferenceError | |
| 187 | 187 | elif self.inst is not None: | |
| 188 | 188 | # build a new instance method with a strong reference to the instance | |
| 189 | - if sys.hexversion >= 0x03000000: | ||
| 189 | + if sys.version_info[0] >= 3: | ||
| 190 | 190 | mtd = types.MethodType(self.func, self.inst()) | |
| 191 | 191 | else: | |
| 192 | 192 | mtd = new.instancemethod(self.func, self.inst(), self.klass) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -102,7 +102,7 @@ def do_copy(target): | |||
| 102 | 102 | def dedent_interpd(func): | |
| 103 | 103 | """A special case of the interpd that first performs a dedent on | |
| 104 | 104 | the incoming docstring""" | |
| 105 | - if isinstance(func, types.MethodType) and sys.hexversion <= 0x03000000: | ||
| 105 | + if isinstance(func, types.MethodType) and sys.version_info[0] < 3: | ||
| 106 | 106 | func = func.im_func | |
| 107 | 107 | return interpd(dedent(func)) | |
| 108 | 108 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1337,10 +1337,10 @@ def findfont(prop, fontext='ttf'): | |||
| 1337 | 1337 | return result | |
| 1338 | 1338 | ||
| 1339 | 1339 | else: | |
| 1340 | - if sys.hexversion >= 0x03000000: | ||
| 1340 | + if sys.version_info[0] >= 3: | ||
| 1341 | 1341 | _fmcache = os.path.join(get_configdir(), 'fontList.py3k.cache') | |
| 1342 | 1342 | else: | |
| 1343 | - _fmcache = os.path.join(get_configdir(), 'fontList.py3k.cache') | ||
| 1343 | + _fmcache = os.path.join(get_configdir(), 'fontList.cache') | ||
| 1344 | 1344 | ||
| 1345 | 1345 | fontManager = None | |
| 1346 | 1346 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -135,7 +135,7 @@ | |||
| 135 | 135 | ('PY_ARRAY_UNIQUE_SYMBOL', 'MPL_ARRAY_API'), | |
| 136 | 136 | ('PYCXX_ISO_CPP_LIB', '1')] | |
| 137 | 137 | ||
| 138 | - if sys.hexversion >= 0x03000000: | ||
| 138 | + if sys.version_info[0] >= 3: | ||
| 139 | 139 | defines.append(('PYCXX_PYTHON_2TO3', '1')) | |
| 140 | 140 | ||
| 141 | 141 | setup_cfg = os.environ.get('MPLSETUPCFG', 'setup.cfg') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments