Skip to content

Commit

Permalink
small bugfix for SDS client, see test fail in feature branch
Browse files Browse the repository at this point in the history
https://travis-ci.org/obspy/obspy/jobs/137294917#L717

that it didn't fail before is likely due to the (deterministic) order of test
execution by unittest, which might have changed due to the new tests in #1413
  • Loading branch information
megies committed Jun 14, 2016
1 parent 10a807a commit 9eb88a1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions obspy/clients/filesystem/sds.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,17 @@ def get_availability_percentage(self, network, station, location, channel,
# subsequently in a place were it's not caught
# see https://bugs.python.org/issue4180
# see e.g. http://blog.ionelmc.ro/2013/06/26/testing-python-warnings/
from obspy.core.stream import __warningregistry__ as \
stream_warningregistry
for key in list(stream_warningregistry.keys()):
if key[0] == _headonly_warning_msg:
stream_warningregistry.pop(key)
try:
from obspy.core.stream import __warningregistry__ as \
stream_warningregistry
except ImportError:
# import error means no warning has been issued from
# obspy.core.stream before, so nothing to do.
pass
else:
for key in list(stream_warningregistry.keys()):
if key[0] == _headonly_warning_msg:
stream_warningregistry.pop(key)
st.sort(keys=['starttime', 'endtime'])
st.traces = [tr for tr in st
if not (tr.stats.endtime < starttime or
Expand Down

0 comments on commit 9eb88a1

Please sign in to comment.