Skip to content

Commit 0818a36

Browse files
authored
Fix importing xarray with python -OO (#1708)
Fixes GH1706
1 parent 4caae2e commit 0818a36

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ install:
8989
- python xarray/util/print_versions.py
9090

9191
script:
92+
- python -OO -c "import xarray"
9293
- py.test xarray --cov=xarray --cov-config ci/.coveragerc --cov-report term-missing --verbose $EXTRA_FLAGS
9394
- git diff upstream/master **/*py | flake8 --diff --exit-zero || true
9495

doc/whats-new.rst

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ Bug fixes
4343
``NumpyIndexingAdapter``. (:issue:`1694`)
4444
By `Keisuke Fujii <https://github.com/fujiisoup>`_
4545

46+
- Fix importing xarray when running Python with ``-OO`` (:issue:`1706`).
47+
By `Stephan Hoyer <https://github.com/shoyer>`_.
48+
4649
- Fix two bugs that were preventing dask arrays from being specified as
4750
coordinates in the DataArray constructor (:issue:`1684`).
4851
By `Joe Hamman <https://github.com/jhamman>`_

xarray/plot/plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def _plot2d(plotfunc):
402402
"""
403403

404404
# Build on the original docstring
405-
plotfunc.__doc__ = '\n'.join((plotfunc.__doc__, commondoc))
405+
plotfunc.__doc__ = '%s\n%s' % (plotfunc.__doc__, commondoc)
406406

407407
@functools.wraps(plotfunc)
408408
def newplotfunc(darray, x=None, y=None, figsize=None, size=None,

0 commit comments

Comments
 (0)