Skip to content

Commit

Permalink
handle missing anndata better
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Jul 11, 2018
1 parent d232b77 commit f791b71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
build
dist
*egg-info
.coverage

#syncthing
.syncthing.*
Expand Down
9 changes: 6 additions & 3 deletions test/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
squareform,
pdist,
)
import warnings

try:
import anndata
except SyntaxError:
except (ImportError, SyntaxError):
# python2 support is missing
import sys
print("Warning: failed to import anndata", file=sys.stderr)
with warnings.catch_warnings():
warnings.filterwarnings("always")
warnings.warn("Warning: failed to import anndata", ImportWarning)
pass

#####################################################
Expand Down

0 comments on commit f791b71

Please sign in to comment.