aboutsummaryrefslogtreecommitdiff
path: root/tools/Internals/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Internals/exceptions.py')
-rwxr-xr-xtools/Internals/exceptions.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/Internals/exceptions.py b/tools/Internals/exceptions.py
index 65d4490..4154d5b 100755
--- a/tools/Internals/exceptions.py
+++ b/tools/Internals/exceptions.py
@@ -3,7 +3,7 @@
To manage them correctly, you should use the `do_main()` function.
"""
-import sys
+import sys as _sys
from .locale import *
#*****************************************************************************#
@@ -48,7 +48,7 @@ def Raise(exc):
try:
raise exc
except PotatoWarning as e:
- print(loc['prefix']['warning'], str(e), file=sys.stderr)
+ print(loc['prefix']['warning'], str(e), file=_sys.stderr)
# Main function wrapper.
@@ -60,7 +60,7 @@ def do_main(main_func):
except SilentException:
exit(1)
except PotatoException as e:
- print(loc['prefix']['error'], str(e), file=sys.stderr)
+ print(loc['prefix']['error'], str(e), file=_sys.stderr)
exit(e.ret)
#*****************************************************************************#
# Internal exceptions #
@@ -272,4 +272,15 @@ class IncompatibleLicensesException(PotatoException):
ags = ('first_license', 'second_license')
msg = loc['exceptions']['IncompatibleLicenses']
+# ---
+# Super-preprocessor exceptions.
+# ---
+
+class DuplicateHeaderException(PotatoException):
+ """ Duplicate header! """
+
+ ret = 2
+ ags = ('name', 'first_module', 'second_module')
+ msg = loc['exceptions']['DuplicateHeader']
+
# End of file.