Skip to content

Commit cb00f0b

Browse files
authored
Merge pull request #6729 from JGoutin/patch-1
FIX: crash if byte-compiled level 2
2 parents dedcbd6 + 5f395e0 commit cb00f0b

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ env:
4343
- NPROC=2
4444
- TEST_ARGS=--no-pep8
4545
- NOSE_ARGS="--processes=$NPROC --process-timeout=300"
46+
- PYTHON_ARGS=
4647

4748
language: python
4849

@@ -51,6 +52,7 @@ matrix:
5152
- python: 2.7
5253
env: MOCK=mock NUMPY=numpy==1.6
5354
- python: 3.4
55+
env: PYTHON_ARGS=-OO
5456
- python: 3.5
5557
env: PANDAS=pandas NOSE_ARGS=--with-coverage
5658
- python: 3.5
@@ -140,7 +142,7 @@ script:
140142
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
141143
python tests.py $NOSE_ARGS $TEST_ARGS
142144
else
143-
gdb -return-child-result -batch -ex r -ex bt --args python tests.py $NOSE_ARGS $TEST_ARGS
145+
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
144146
fi
145147
else
146148
cd doc

lib/mpl_toolkits/mplot3d/axes3d.py

+20-16
Original file line numberDiff line numberDiff line change
@@ -746,19 +746,21 @@ def get_xlim3d(self):
746746
return self.xy_viewLim.intervalx
747747
get_xlim3d.__doc__ = maxes.Axes.get_xlim.__doc__
748748
get_xlim = get_xlim3d
749-
get_xlim.__doc__ += """
750-
.. versionchanged :: 1.1.0
751-
This function now correctly refers to the 3D x-limits
752-
"""
749+
if get_xlim.__doc__ is not None:
750+
get_xlim.__doc__ += """
751+
.. versionchanged :: 1.1.0
752+
This function now correctly refers to the 3D x-limits
753+
"""
753754

754755
def get_ylim3d(self):
755756
return self.xy_viewLim.intervaly
756757
get_ylim3d.__doc__ = maxes.Axes.get_ylim.__doc__
757758
get_ylim = get_ylim3d
758-
get_ylim.__doc__ += """
759-
.. versionchanged :: 1.1.0
760-
This function now correctly refers to the 3D y-limits.
761-
"""
759+
if get_ylim.__doc__ is not None:
760+
get_ylim.__doc__ += """
761+
.. versionchanged :: 1.1.0
762+
This function now correctly refers to the 3D y-limits.
763+
"""
762764

763765
def get_zlim3d(self):
764766
'''Get 3D z limits.'''
@@ -780,22 +782,24 @@ def set_xscale(self, value, **kwargs) :
780782
self.xaxis._set_scale(value, **kwargs)
781783
self.autoscale_view(scaley=False, scalez=False)
782784
self._update_transScale()
783-
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
785+
if maxes.Axes.set_xscale.__doc__ is not None:
786+
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
784787
785-
.. versionadded :: 1.1.0
786-
This function was added, but not tested. Please report any bugs.
787-
"""
788+
.. versionadded :: 1.1.0
789+
This function was added, but not tested. Please report any bugs.
790+
"""
788791

789792
def set_yscale(self, value, **kwargs) :
790793
self.yaxis._set_scale(value, **kwargs)
791794
self.autoscale_view(scalex=False, scalez=False)
792795
self._update_transScale()
793796
self.stale = True
794-
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
797+
if maxes.Axes.set_yscale.__doc__ is not None:
798+
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
795799
796-
.. versionadded :: 1.1.0
797-
This function was added, but not tested. Please report any bugs.
798-
"""
800+
.. versionadded :: 1.1.0
801+
This function was added, but not tested. Please report any bugs.
802+
"""
799803

800804
@docstring.dedent_interpd
801805
def set_zscale(self, value, **kwargs) :

tests.py

+2
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ def run(extra_args):
5353
extra_args.extend(['-a', '!network'])
5454
sys.argv.remove('--no-network')
5555

56+
print('Python byte-compilation optimization level: %d' % sys.flags.optimize)
57+
5658
run(extra_args)

0 commit comments

Comments
 (0)