-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathffi-conditions.lisp
54 lines (48 loc) · 1.87 KB
/
ffi-conditions.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(in-package #:python.cffi)
;; Python must have been initialized for our macroexpansions to work.
(eval-when (:compile-toplevel :load-toplevel)
(.initialize))
(defpyexception "BaseException" (python-condition)
(("args" :initarg :args)))
(defpyexception "Exception" () ())
(defpyexception "StandardError" (python-error) ())
(defpyexception "ArithmeticError" () ())
(defpyexception "LookupError" () ())
(defpyexception "AssertionError" () ())
(defpyexception "AttributeError" () ())
(defpyexception "EOFError" () ())
(defpyexception "EnvironmentError" ()
(("errno" :initarg :errno)
("strerror" :initarg :strerror)
("filename" :initarg :filename)))
(defpyexception "FloatingPointError" () ())
(defpyexception "IOError" () ())
(defpyexception "ImportError" () ())
(defpyexception "IndexError" () ())
(defpyexception "KeyError" () ())
(defpyexception "KeyboardInterrupt" () ())
(defpyexception "MemoryError" () ())
(defpyexception "NameError" () ())
(defpyexception "RuntimeError" () ())
(defpyexception "NotImplementedError" () ())
(defpyexception "OSError" () ())
(defpyexception "OverflowError" () ())
(defpyexception "ReferenceError" () ())
(defpyexception "SyntaxError" ()
(("filename" :initarg :filename)
("lineno" :initarg :lineno)
("offset" :initarg :offset)
("text" :initarg :text)))
(defpyexception "SystemError" () ())
(defpyexception "SystemExit" () ())
(defpyexception "TypeError" () ())
(defpyexception "ValueError" () ())
#+windows (defpyexception "WindowsError" () ())
(defpyexception "ZeroDivisionError" () ())
(eval-when (:compile-toplevel :load-toplevel)
(.finalize))
(defmethod print-object ((condition base-exception) stream)
(write (first (slot-value condition 'args)) :stream stream))
(defmethod print-object ((condition environment-error) stream)
(write (slot-value condition 'strerror) :stream stream))
#+(or) (burgled-batteries:run "1+")