aboutsummaryrefslogtreecommitdiff
path: root/industriart/compat.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-07-15 21:57:12 +0100
committerGuido Günther <agx@sigxcpu.org>2014-07-16 12:51:15 +0200
commit37123e9ca25778d53b675626ddc32ff2e3e04314 (patch)
treeb0e7ca18738c10925bb410c323ddb8fbb51c738a /industriart/compat.py
Initial commit
Diffstat (limited to 'industriart/compat.py')
-rw-r--r--industriart/compat.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/industriart/compat.py b/industriart/compat.py
new file mode 100644
index 0000000..06fe440
--- /dev/null
+++ b/industriart/compat.py
@@ -0,0 +1,13 @@
+"""Compatiblity with older python"""
+
+import sys
+
+# python 2.7 introduced a NullHandler which we want to use, but to support
+# older versions, we implement our own if needed.
+if sys.version_info[:2] > (2, 6):
+ from logging import NullHandler
+else:
+ from logging import Handler
+ class NullHandler(Handler):
+ def emit(self, record):
+ pass