From 8733038b4de44a8cfb669420621597457eeef88a Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Thu, 6 Sep 2018 23:40:42 +0200 Subject: email policy works mm --- modules/language/python/exceptions.scm | 74 ++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 25 deletions(-) (limited to 'modules/language/python/exceptions.scm') diff --git a/modules/language/python/exceptions.scm b/modules/language/python/exceptions.scm index 0a3689f..87dd3c5 100644 --- a/modules/language/python/exceptions.scm +++ b/modules/language/python/exceptions.scm @@ -1,24 +1,27 @@ (define-module (language python exceptions) #:use-module (oop pf-objects) #:use-module (oop goops) - #:export (StopIteration GeneratorExit RuntimeError + #:export (StopIteration GeneratorExit RuntimeError TabError Exception ValueError TypeError IndexError KeyError AttributeError ArgumentError SyntaxError SystemException OSError ProcessLookupError PermissionError None NotImplemented NotImplementedError - RunTimeError AssertionError ImportError + AssertionError ImportError ModuleNotFoundError BlockingIOError InterruptedError BaseException - ZeroDivisionError ArithmeticError + ZeroDivisionError OverflowError RecursionError Warning DeprecationWarning BytesWarning - ResourceWarning UserWarning + ResourceWarning UserWarning UnicodeTranslateError UnicodeDecodeError LookupError IndentationError KeyboardInterrupt MemoryError NameError EOFError UnicodeError UnicodeEncodeError FileExistsError FileNotFoundError IsADirectoryError - EnvironmentError)) + EnvironmentError ConnectionError NotADirectoryError + ConnectionResetError ChildProcessError TimeOutError + BrokenPipeError ConnectionAbortedError + ConnectionRefusedError ArithmeticError)) (define-syntax-rule (aif it p x y) (let ((it p)) (if it x y))) @@ -71,46 +74,67 @@ (define StopIteration 'StopIteration) (define GeneratorExit 'GeneratorExit) (define-er EnvironmentError 'EnvironmentError) -(define-er UnicodeEncodeError 'UnicodeEncodeError) -(define-er FileExistsError 'FileExistsError) -(define-er FileNotFoundError 'FileNotFoundError) -(define-er IsADirectoryError 'IsADirectoryError) -(define-er UnicodeError 'UnicodeError) + (define-er EOFError 'EOFError) (define-er MemoryError 'MemoryError) (define-er NameError 'NameError) -(define-er UnicodeDecodeError 'UnicodeDecodeError) + +(define-er ValueError 'ValueError) +(define-python-class UnicodeError (ValueError)) +(define-python-class UnicodeDecodeError (UnicodeError)) +(define-python-class UnicodeEncodeError (UnicodeError)) +(define-python-class UnicodeTranslateError (UnicodeError)) + (define-er LookupError 'LookupError) -(define-er IndentationError 'IndentationError) -(define-er OverflowError 'OverflowError) + (define-python-class IndexError (LookupError)) + (define-python-class KeyError (LookupError)) + +(define-er ArithmeticError 'OverflowError) + (define-python-class OverflowError (ArithmeticError)) + (define-python-class ZeroDivisionError (ArithmeticError)) + + (define-er KeyboardInterrupt 'KeyboardInterrupt) -(define-er RecursionError 'RecursionError) -(define-er ArithmeticError 'ArithmeticError) (define-er BaseException 'BaseException) -(define-er ZeroDivisionError 'ZeroDivisionError) (define-er SystemException 'SystemException) (define-er RuntimeError 'RuntimeError) -(define-er IndexError 'IndexError) + (define-python-class NotImplementedError (RuntimeError)) + (define-python-class RecursionError (RuntimeError)) + + (define-er ArgumentError 'IndexError) -(define-er ValueError 'ValueError) + +(define-er OSError 'OSError) + (define-python-class BlockingIOError (OSError)) + (define-python-class ChildProcessError (OSError)) + (define-python-class ConnectionError (OSError)) + (define-python-class BrokenPipeError (ConnectionError)) + (define-python-class ConnectionAbortedError (ConnectionError)) + (define-python-class ConnectionRefusedError (ConnectionError)) + (define-python-class ConnectionResetError (ConnectionError)) + (define-python-class FileExistsError (OSError)) + (define-python-class FileNotFoundError (OSError)) + (define-python-class InterruptedError (OSError)) + (define-python-class IsADirectoryError (OSError)) + (define-python-class NotADirectoryError (OSError)) + (define-python-class PermissionError (OSError)) + (define-python-class ProcessLookupError (OSError)) + (define-python-class TimeOutError (OSError)) (define None 'None) -(define-er KeyError 'KeyError) + (define-er TypeError 'TypeError) (define-er AttributeError 'AttributeError) (define-er SyntaxError 'SyntaxError) -(define-er OSError 'OSError) -(define-er ProcessLookupError 'ProcessLookupError) -(define-er PermissionError 'PermissionError) -(define-er NotImplementedError 'NotImplementedError) + (define-python-class IndentationError (SyntaxError)) + (define-python-class TabError (IndentationError)) + (define-er RunTimeError 'RunTimeError) (define AssertionError 'AssertionError) (define-er ImportError 'ImportError) (define-er ModuleNotFoundError (ImportError) 'ModuleNotFoundError) -(define-er BlockingIOError 'BlockingIOError) -(define-er InterruptedError 'OSError) (define NotImplemented (list 'NotImplemented)) -- cgit v1.2.3