From: Oleg Broytman Date: Mon, 25 Jul 2016 16:05:26 +0000 (+0300) Subject: Fix exceptions for Py3 compatibility X-Git-Tag: 3.0.0b2~1 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=7f8cd12c390d9c7dacdec849982d7ca28f0a44e2;p=m_lib.git Fix exceptions for Py3 compatibility --- diff --git a/m_lib/flad/flad.py b/m_lib/flad/flad.py index da430dd..8ca1093 100644 --- a/m_lib/flad/flad.py +++ b/m_lib/flad/flad.py @@ -5,7 +5,8 @@ # Flad restriction error -checking_error = "flad.checking_error" +class checking_error(Exception): + pass # Default key/value separator def_keysep = ": " diff --git a/m_lib/flad/fladc.py b/m_lib/flad/fladc.py index c9bc73e..af8ba37 100644 --- a/m_lib/flad/fladc.py +++ b/m_lib/flad/fladc.py @@ -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): diff --git a/m_lib/flad/fladw.py b/m_lib/flad/fladw.py index fa00074..5901925 100644 --- a/m_lib/flad/fladw.py +++ b/m_lib/flad/fladw.py @@ -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("^ *\[(.+)\] *$")