[Zope3-dev] Re: Bare excepts in z3c.zalchemy

Jürgen Kartnaller juergen at kartnaller.at
Sat Mar 3 09:34:09 EST 2007



Philipp von Weitershausen wrote:
> Jürgen Kartnaller wrote:
>> datamanager.py: 2 try/except
>> They are there because it is possible that a table already exists when 
>> trying to create it or doesn't exist when trying to delete it.
>> As I remember when I wrote this I couldn't find a better way, but I'm 
>> there is a better way in the latest version of sqlalchemy.
> 
> Good to know.
> 
>> container.py: 2 try/except
>> get speaks for itself, it think!
> 
> Yes, those aren't bare excepts. Those make sense to me :)
> 
>> __len__ contains it to be able to view the container even if there is 
>> no database connection. Otherwise if the database connection is lost 
>> you even can not view the container in zmi.
>>
>> So tons == 4 :)
> 
> Okay, okay, I was exaggerating :). But there are some bare excepts in 
> the tests as well:
> 
>   $ grep -nH -rI except: *
>   datamanager.py:153:    except:
>   datamanager.py:162:    except:

Maybe one can figure out which exception we need to catch here.

>   testing/__init__.py:31:        except:
>   tests/test_zalchemy.py:35:    except:
>   tests/test_zalchemy.py:39:    except:
>   tests/test_zalchemy.py:43:    except:

Yes these stupid except's are because of windows :(
I wrote the first version on windows and had the problem that windows 
didn't let me delete the files.

Jürgen



More information about the Zope3-dev mailing list