From 3811f20cacb193a963cb6889dba35e01510af0b4 Mon Sep 17 00:00:00 2001 From: devicerandom Date: Mon, 2 Mar 2009 13:36:42 +0000 Subject: [PATCH] (generalvclamp.py) error checking in slope command --- generalvclamp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generalvclamp.py b/generalvclamp.py index b7c9ed0..f4351d0 100644 --- a/generalvclamp.py +++ b/generalvclamp.py @@ -228,7 +228,11 @@ class generalvclampCommands: # Calls the function linefit_between parameters=[0,0,[],[]] - parameters=self.linefit_between(clickedpoints[0],clickedpoints[1]) + try: + parameters=self.linefit_between(clickedpoints[0],clickedpoints[1]) + except: + print 'Cannot fit. Did you click twice the same point?' + return # Outputs the relevant slope parameter print 'Slope:' -- 2.26.2