Re: can try expect have if else.

2016-02-22 Thread Steven D'Aprano
On Mon, 22 Feb 2016 03:12 am, Ganesh Pal wrote: > Hi Team, > > Iam on python 2.6 , need input on the below piece of code. > > > EXIT_STATUS_ERROR=1 > > def create_dataset(): > """ > """ > logging.info("Dataset create.Started !!!") > try: > if

Re: can try expect have if else.

2016-02-21 Thread Ian Kelly
On Feb 21, 2016 9:13 AM, "Ganesh Pal" wrote: > > Hi Team, > > Iam on python 2.6 , need input on the below piece of code. Python 2.6 isn't supported and hasn't been since October 2013. Is there something preventing you from upgrading to 2.7? > EXIT_STATUS_ERROR=1 > > def

Re: can try expect have if else.

2016-02-21 Thread Ganesh Pal
On Sun, Feb 21, 2016 at 10:37 PM, Ben Finney wrote: > What result do you get when running that code? What empirical reason do > you have to think it would work or not work? I wanted to know was is it good to have if else with in a try expect block , I was checking

Re: can try expect have if else.

2016-02-21 Thread Ben Finney
Ganesh Pal writes: > 1. Can we have if else with in a try except block What result do you get when running that code? What empirical reason do you have to think it would work or not work? > 2. How can the above code be improved The following sequence of statements::

can try expect have if else.

2016-02-21 Thread Ganesh Pal
Hi Team, Iam on python 2.6 , need input on the below piece of code. EXIT_STATUS_ERROR=1 def create_dataset(): """ """ logging.info("Dataset create.Started !!!") try: if os.path.ismount("/nfs_mount"): touch_file("inode_fixcrc.txt")