From 7f8cd12c390d9c7dacdec849982d7ca28f0a44e2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 25 Jul 2016 19:05:26 +0300 Subject: [PATCH] Fix exceptions for Py3 compatibility --- m_lib/flad/flad.py | 3 ++- m_lib/flad/fladc.py | 5 ++++- m_lib/flad/fladw.py | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) 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("^ *\[(.+)\] *$") -- 2.39.5