can try expect have if else.
ian.g.kelly at gmail.com
Sun Feb 21 14:22:02 EST 2016
On Feb 21, 2016 9:13 AM, "Ganesh Pal" <ganesh1pal at gmail.com> 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?
> def create_dataset():
Empty docstring is pointless.
> logging.info("Dataset create.....Started !!!")
This is just a pet peeve of mine, but do info-level log messages really
need triple exclamation marks?
> if os.path.ismount("/nfs_mount"):
Is this file really meant to be created in the current working directory,
or is it supposed to be inside the /nfs_mount?
> logging.info("Dataset create.....Done !!!")
> raise Exception("/nfs_mount is not mounted. Dataset create
> failed !!!")
> return False
> except Exception as e:
> sys.stderr.write("Dataset create failed...Exiting !!!")
> return True
> 1. Can we have if else with in a try except block
Yes, of course.
More information about the Python-list