Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash if byte-compiled level 2 #6729

Merged
merged 3 commits into from Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)