summaryrefslogtreecommitdiffstats
path: root/lib/python/helpers.py
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2020-07-16 13:16:14 +0200
committerEmilio Pozuelo Monfort <pochu@debian.org>2020-07-29 10:20:33 +0200
commit37e775cc5d145a4e5c573278c694a098b6c10066 (patch)
tree8fcba54391f63a94754cda64eeec6c598548e662 /lib/python/helpers.py
parent98dbd1d464037d7e15773c28ec93075d75213be2 (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.py7
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)

© 2014-2024 Faster IT GmbH | imprint | privacy policy