ShuffleBox / django-rcsfield

Automatically exported from code.google.com/p/django-rcsfield
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Replace finally statement to be compatible with python 2.4 #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
$ 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?

Original issue reported on code.google.com by kei...@gmail.com on 20 Aug 2008 at 10:37

GoogleCodeExporter commented 9 years ago
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.

Original comment by kei...@gmail.com on 20 Aug 2008 at 11:23

GoogleCodeExporter commented 9 years ago
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.

Original comment by a...@rcs4u.de on 21 Aug 2008 at 2:35

GoogleCodeExporter commented 9 years ago
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.

Original comment by a...@rcs4u.de on 22 Aug 2008 at 8:06

GoogleCodeExporter commented 9 years ago
It works. Thanks. :)

Original comment by kei...@gmail.com on 22 Aug 2008 at 9:36