Re: try-except with no exceptions

2016-10-15 Thread Nobody
On Thu, 13 Oct 2016 15:06:25 +0100, Daiyue Weng wrote: > I know that such try-catch usage is generally a bad practice, since it > can't locate the root of the exceptions. > > I am wondering how to correct the code above Either identify the specific exceptions you're expecting, or if you're inter

Re: try-except with no exceptions

2016-10-13 Thread Ben Finney
Daiyue Weng writes: > I am wondering how to correct the code above (what it tries to do is > basically trying one processing block, if not working, running another > block of code in except). Also a warning 'Too broad exception clause' > will be generated. Yes. You need to be *very* clear about

Re: try-except with no exceptions

2016-10-13 Thread Peter Otten
Daiyue Weng wrote: > Hi, I have seen code using try_except with no exceptions, > > from dateutil import parser > > try: > from_date = datetime.datetime.strptime(parameters['from_date'], > '%Y-%m-%d %H:%M:%S.%f') > to_date = datetime.datetime

Re: try-except with no exceptions

2016-10-13 Thread Jussi Piitulainen
Daiyue Weng writes: > Hi, I have seen code using try_except with no exceptions, > > from dateutil import parser > > try: > from_date = datetime.datetime.strptime(parameters['from_date'], > '%Y-%m-%d %H:%M:%S.%f') > to_date = datetime.datetime.st

try-except with no exceptions

2016-10-13 Thread Daiyue Weng
Hi, I have seen code using try_except with no exceptions, from dateutil import parser try: from_date = datetime.datetime.strptime(parameters['from_date'], '%Y-%m-%d %H:%M:%S.%f') to_date = datetime.datetime.strptime(parameters['to_date'], '%Y-%m-%d

Re: No Exceptions

2008-07-08 Thread Gary Herron
Robert Rawlins wrote: Morning Guys, This morning I’ve been having a strange issue where my application doesn’t appear to raise any exceptions. Even when manually placing code in the application which raises an exception explicitly like: Raise Exception, “This is a test exception” The appli

No Exceptions

2008-07-08 Thread Robert Rawlins
Morning Guys, This morning I've been having a strange issue where my application doesn't appear to raise any exceptions. Even when manually placing code in the application which raises an exception explicitly like: Raise Exception, "This is a test exception" The applicat