Skip to content

Commit

Permalink
Merge pull request #215 from sloria/collections-warning
Browse files Browse the repository at this point in the history
Address warning about importing from collections on Python 3
  • Loading branch information
blag authored Feb 12, 2019
2 parents ca201a9 + c95a5d2 commit d49da34
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flex/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from __future__ import unicode_literals

import numbers
import collections
try:
from collections.abc import Sequence, Mapping
except ImportError: # Python 2
from collections import Sequence, Mapping
import six


Expand Down Expand Up @@ -32,8 +35,8 @@
INTEGER: six.integer_types,
NUMBER: (numbers.Number,),
STRING: (six.binary_type, six.text_type),
ARRAY: (collections.Sequence,),
OBJECT: (collections.Mapping,),
ARRAY: (Sequence,),
OBJECT: (Mapping,),
}

TRUE_VALUES = set(('true', 'True', '1'))
Expand Down

0 comments on commit d49da34

Please sign in to comment.