Ace Grace
Ace Grace

Reputation: 641

does the django-firebird 1.5.0.rc.2 driver work with Python 3.3?

I am trying to use Firebird with django but when I install it with .

pip install django-firebird

I get the following error

    File "C:\Python33\Lib\site-packages\firebird\base.py", line 9
  except ImportError, e:
                    ^

SyntaxError: invalid syntax

File "C:\Python33\Lib\site-packages\firebird\creation.py", line 76
  print "_rollback_works"
                        ^

SyntaxError: invalid syntax

Example code in the base.py is as follows :-

        except Database.IntegrityError, e:
        raise utils.IntegrityError, utils.IntegrityError(*self.error_info(e, query, param_list[0])), sys.exc_info()[2]

I am running Windows, Python 3.3 and Django 1.5.

Is this a syntax change with Python 3?

The package says it works with python 2.6+

Regards

Any ideas?

Upvotes: 1

Views: 213

Answers (1)

catherine
catherine

Reputation: 22808

In Python 2:

 except ImportError, e:

 print "_rollback_works"

In Python 3:

 //Exception handling syntax changes slightly, "as"
 except ImportError as err:

 //print is now a function print()
 print ("_rollback_works")

That's why you get that errors.

Upvotes: 1

Related Questions