[PyQt] trouble running PyQt-4.5 configure.py with python3

Darren Dale dsdale24 at gmail.com
Wed Mar 25 11:29:45 GMT 2009


This morning I tried to install last nights snapshots on Kubuntu Jaunty for
python-3.0.1. "python configure.py" would get up to the point were this is
printed:

Type '2' to view the GPL v2 license.
Type '3' to view the GPL v3 license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.

but it would not prompt me to accept the license. The script was getting
stuck in the while loop that asks if we accept the terms of the license. I
edited configure.py:

        # Handle Python v2.
        try:
            input = raw_input
        except NameError:
            pass

        while 1:
            try:
                resp = input("Do you accept the terms of the license? ")
            except KeyboardInterrupt:
                raise SystemExit
#            except:
#                resp = ""

and ran the script again, which yielded:

An internal error occured.  Please report all the output from the program,
including the following traceback, to support at riverbankcomputing.com.
Traceback (most recent call last):
  File "configure.py", line 1900, in <module>
    main()
  File "configure.py", line 1848, in main
    check_license()
  File "configure.py", line 1478, in check_license
    resp = input("Do you accept the terms of the license? ")
UnboundLocalError: local variable 'input' referenced before assignment


If I comment this out instead:

#        try:
#            input = raw_input
#        except NameError:
#            pass

Then I configure.py will run without errors with python-3. Maybe this is a
bug in python, or just Jaunty's python, but perhaps a workaround could be
considered for configure.py.

Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090325/988d76ba/attachment-0001.html


More information about the PyQt mailing list