]> git.phdru.name Git - m_lib.git/commitdiff
Fix exceptions for Py3 compatibility
authorOleg Broytman <phd@phdru.name>
Mon, 25 Jul 2016 16:05:26 +0000 (19:05 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 25 Jul 2016 21:17:22 +0000 (00:17 +0300)
m_lib/flad/flad.py
m_lib/flad/fladc.py
m_lib/flad/fladw.py

index da430ddf585a68c3542ebab9659a5c74dcd07b33..8ca1093607a4b3d1f7b5fa5ca77ed07d5d93b637 100644 (file)
@@ -5,7 +5,8 @@
 
 
 # Flad restriction error
-checking_error = "flad.checking_error"
+class checking_error(Exception):
+    pass
 
 # Default key/value separator
 def_keysep = ": "
index c9bc73e35c41e6fb9a6195fd5c659506ca0955f4..af8ba37584efa514df39effc6033e2d805ce3230 100644 (file)
@@ -6,7 +6,10 @@
 from m_lib.flad import flad, fladm
 
 
-error = "fladc.error" # Too many records
+from .flad import checking_error
+class error(checking_error):
+    # Too many records
+    pass
 
 
 class Flad_Conf(dict):
index fa0007443d7060a54257a416ab60d2d6160f11b5..5901925db43eadca8e2628f958096b2fda2ec24a 100644 (file)
@@ -7,8 +7,12 @@ import re
 from m_lib.flad import flad
 
 
-error = "fladw.error"
-section_error = "fladw.section_error"
+from .flad import checking_error
+class error(checking_error):
+    pass
+
+class section_error(checking_error):
+    pass
 
 
 re_section = re.compile("^ *\[(.+)\] *$")