diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-07-16 13:16:14 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-07-29 10:20:33 +0200 |
commit | 37e775cc5d145a4e5c573278c694a098b6c10066 (patch) | |
tree | 8fcba54391f63a94754cda64eeec6c598548e662 /lib/python/helpers.py | |
parent | 98dbd1d464037d7e15773c28ec93075d75213be2 (diff) |
lib/python: use isinstance rather than types
types.TypeFoo are gone in python3.
Diffstat (limited to 'lib/python/helpers.py')
-rw-r--r-- | lib/python/helpers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/python/helpers.py b/lib/python/helpers.py new file mode 100644 index 0000000000..1bfcf94375 --- /dev/null +++ b/lib/python/helpers.py @@ -0,0 +1,7 @@ +# helpers.py -- utility functions that don't belong elsewhere + +def isstring(s): + try: + return isinstance(s, basestring) + except NameError: + return isinstance(s, str) |