summaryrefslogtreecommitdiff
path: root/modules/language/python/exceptions.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-09-06 23:40:42 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-09-06 23:40:42 +0200
commit8733038b4de44a8cfb669420621597457eeef88a (patch)
tree9f7345b4b407ea0919320e17955b058cb2f2a5bc /modules/language/python/exceptions.scm
parentb950c0d70a1d2c95da8d60aca7af02bc50542a2b (diff)
email policy works mm
Diffstat (limited to 'modules/language/python/exceptions.scm')
-rw-r--r--modules/language/python/exceptions.scm74
1 files changed, 49 insertions, 25 deletions
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))