Skip to content

Commit

Permalink
Fix coordsel.py "collections.Iterable" deprecation
Browse files Browse the repository at this point in the history
"DeprecationWarning: Using or importing the ABCs from 'collections' instead of
from 'collections.abc' is deprecated, and in 3.8 it will stop working"
  • Loading branch information
Kevin Hallock committed Jan 9, 2019
1 parent a36f9b7 commit 7fdd738
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions coordsel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import time
import numpy as N
import Nio
import collections
try:
from collections.abc import Iterable
except ImportError:
# collections.Iterable is deprecated, and in Python 3.8 it will stop working
from collections import Iterable
from _xarray import _intp, _rindex, _xArray

__version__ = '0.1.0'
Expand Down Expand Up @@ -191,7 +195,7 @@ class idxSelect(dict):
def __init__(self, dimensions):
""" idxSelect(dimensions) """

if not isinstance(dimensions, collections.Iterable):
if not isinstance(dimensions, Iterable):
raise TypeError("Invalid argument type")
data = {}
for key in dimensions:
Expand Down

0 comments on commit 7fdd738

Please sign in to comment.