Re: How to ingore "AttributeError: exception

2017-09-22 Thread Ganesh Pal
> > > is a perfectly good pattern to use. > Thanks looks nice :) > > > > > > > > I am a Linux user on Python 2.7 > > Have you considered moving to Python 3? > Not yet , but Is there something that I need to consider in the current context? Regards, Ganesh -- https://mail.python.org/mailma

Re: How to ingore "AttributeError: exception

2017-09-22 Thread Paul Moore
On 22 September 2017 at 10:05, Thomas Jollans wrote: > On 2017-09-22 10:55, Ganesh Pal wrote: >> I have two possible values for Z_block in the block code i.e >> disk_object.data.data.di_data[0] or block.data.data.di_data.data[0][0] >> >> >> def get_block(): >> ''' Get Z block '' >> >> if b

Re: How to ingore "AttributeError: exception

2017-09-22 Thread Thomas Jollans
On 2017-09-22 10:55, Ganesh Pal wrote: > I have two possible values for Z_block in the block code i.e > disk_object.data.data.di_data[0] or block.data.data.di_data.data[0][0] > > > def get_block(): > ''' Get Z block '' > > if block.data.data.di_data.data[0][0] is not None: > Z_bl

How to ingore "AttributeError: exception

2017-09-22 Thread Ganesh Pal
I have two possible values for Z_block in the block code i.e disk_object.data.data.di_data[0] or block.data.data.di_data.data[0][0] def get_block(): ''' Get Z block '' if block.data.data.di_data.data[0][0] is not None: Z_block = block.data.data.di_data.data[0][0] else: