[Python-checkins] r54913 - tracker/roundup-src/roundup/cgi/client.py

Georg Brandl g.brandl at gmx.net
Sat Apr 21 22:27:13 CEST 2007


erik.forsberg schrieb:

> Modified: tracker/roundup-src/roundup/cgi/client.py
> ==============================================================================
> --- tracker/roundup-src/roundup/cgi/client.py	(original)
> +++ tracker/roundup-src/roundup/cgi/client.py	Sat Apr 21 18:42:55 2007
> @@ -349,9 +349,28 @@
>          if now - last_clean < hour:
>              return
>  
> +        # This is a bit ugly, but right now, I'm too lazy to fix a new API
> +        # in all rdbms-based backends to cope with this problem that only
> +        # appears on Postgres.
> +        try:
> +            from psycopg import ProgrammingError
> +        except ImportError:
> +            from psycopg2.psycopg1 import ProgrammingError
> +        except ImportError:
> +            ProgrammingError = None

Note that this doesn't work as intended... you'll have to nest a try block.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list