Export to GitHub

django-rcsfield - issue #2

Replace finally statement to be compatible with python 2.4


Posted on Aug 20, 2008 by Massive Monkey

$ python Python 2.4.3 (#1, May 24 2008, 13:47:28) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> try: ... pass ... except: ... pass ... finally: File "<stdin>", line 5 finally: ^ SyntaxError: invalid syntax

This is CentOS 5.2 running. I don't know clear way to install python 2.5 other than make and make install.

Will you please replace finally statement to be compatible with not-so-latest version of python?

Comment #1

Posted on Aug 20, 2008 by Massive Monkey

It's done by changing try-except-finally into try: try-except finally: pass. I think it's better to be old-style and more compatible than vice versa.

Comment #2

Posted on Aug 21, 2008 by Happy Panda

thanks for reporting, I haven't tested the code with python 2.4 but I will try to do my best to make it compatible.

Comment #3

Posted on Aug 22, 2008 by Happy Panda

i have changed the try-except-finally statements, but i haven't hab the chance to test it in a python-2.4 environment, feedback is very welcome.

Comment #4

Posted on Aug 22, 2008 by Massive Monkey

It works. Thanks. :)

Status: Fixed

Labels:
Type-Defect Priority-Medium