summaryrefslogtreecommitdiff
path: root/modules/language/python
diff options
context:
space:
mode:
Diffstat (limited to 'modules/language/python')
-rw-r--r--modules/language/python/spec.scm26
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/language/python/spec.scm b/modules/language/python/spec.scm
index f1fc78b..46b46e8 100644
--- a/modules/language/python/spec.scm
+++ b/modules/language/python/spec.scm
@@ -37,18 +37,19 @@
(define (e x) (eval (c #t x) (current-module)))
+(define (ignore-errors proc)
+ "Run PROC and ignore all errors."
+ (catch #t (lambda () (proc)) (const #f)))
(define (int)
- (catch #t
- (lambda ()
- (not (fluid-ref (@@ (system base compile) %in-compile))))
- (const #f)))
+ (ignore-errors
+ (lambda ()
+ (not (fluid-ref (@@ (system base compile) %in-compile))))))
(define (in)
- (catch #t
- (lambda ()
- (fluid-set! (@@ (system base compile) %in-compile) #t))
- (const #f)))
+ (ignore-errors
+ (lambda ()
+ (fluid-set! (@@ (system base compile) %in-compile) #t))))
(define mapper (make-weak-key-hash-table))
@@ -66,11 +67,10 @@
(hash-set! mapper port port2)
(lp port2)))))))
-(catch #t
- (lambda ()
- (set! (@@ (ice-9 readline) *readline-completion-function*)
- (complete-python e)))
- (const #f))
+(ignore-errors
+ (lambda ()
+ (set! (@@ (ice-9 readline) *readline-completion-function*)
+ (complete-python e))))
(define-language python
#:title "python"