Skip to content

Commit

Permalink
Merge pull request #6729 from JGoutin/patch-1
Browse files Browse the repository at this point in the history
FIX: crash if byte-compiled level 2
  • Loading branch information
tacaswell committed Jul 12, 2016
2 parents dedcbd6 + 5f395e0 commit cb00f0b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -43,6 +43,7 @@ env:
- NPROC=2
- TEST_ARGS=--no-pep8
- NOSE_ARGS="--processes=$NPROC --process-timeout=300"
- PYTHON_ARGS=

language: python

Expand All @@ -51,6 +52,7 @@ matrix:
- python: 2.7
env: MOCK=mock NUMPY=numpy==1.6
- python: 3.4
env: PYTHON_ARGS=-OO
- python: 3.5
env: PANDAS=pandas NOSE_ARGS=--with-coverage
- python: 3.5
Expand Down Expand Up @@ -140,7 +142,7 @@ script:
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
python tests.py $NOSE_ARGS $TEST_ARGS
else
gdb -return-child-result -batch -ex r -ex bt --args python tests.py $NOSE_ARGS $TEST_ARGS
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
fi
else
cd doc
Expand Down
36 changes: 20 additions & 16 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Expand Up @@ -746,19 +746,21 @@ def get_xlim3d(self):
return self.xy_viewLim.intervalx
get_xlim3d.__doc__ = maxes.Axes.get_xlim.__doc__
get_xlim = get_xlim3d
get_xlim.__doc__ += """
.. versionchanged :: 1.1.0
This function now correctly refers to the 3D x-limits
"""
if get_xlim.__doc__ is not None:
get_xlim.__doc__ += """
.. versionchanged :: 1.1.0
This function now correctly refers to the 3D x-limits
"""

def get_ylim3d(self):
return self.xy_viewLim.intervaly
get_ylim3d.__doc__ = maxes.Axes.get_ylim.__doc__
get_ylim = get_ylim3d
get_ylim.__doc__ += """
.. versionchanged :: 1.1.0
This function now correctly refers to the 3D y-limits.
"""
if get_ylim.__doc__ is not None:
get_ylim.__doc__ += """
.. versionchanged :: 1.1.0
This function now correctly refers to the 3D y-limits.
"""

def get_zlim3d(self):
'''Get 3D z limits.'''
Expand All @@ -780,22 +782,24 @@ def set_xscale(self, value, **kwargs) :
self.xaxis._set_scale(value, **kwargs)
self.autoscale_view(scaley=False, scalez=False)
self._update_transScale()
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
if maxes.Axes.set_xscale.__doc__ is not None:
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""

def set_yscale(self, value, **kwargs) :
self.yaxis._set_scale(value, **kwargs)
self.autoscale_view(scalex=False, scalez=False)
self._update_transScale()
self.stale = True
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
if maxes.Axes.set_yscale.__doc__ is not None:
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""

@docstring.dedent_interpd
def set_zscale(self, value, **kwargs) :
Expand Down
2 changes: 2 additions & 0 deletions tests.py
Expand Up @@ -53,4 +53,6 @@ def run(extra_args):
extra_args.extend(['-a', '!network'])
sys.argv.remove('--no-network')

print('Python byte-compilation optimization level: %d' % sys.flags.optimize)

run(extra_args)

0 comments on commit cb00f0b

Please sign in to comment.