error in exception syntax

A

Aaron Gray

On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the
following error :-

File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13
except OSError, err:
^

It works okay on my Linux machine running Python 2.6.2.

Many thanks in advance,

Aaron
 
A

Alex Willmer

On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the
following error :-

    File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13
      except OSError, err:
                ^

It works okay on my Linux machine running Python 2.6.2.

Python 3.x is a different beast to Python 2.x. It has a number of
backward incompatible changes, including the try/except syntax.
Install the latest Python 2.x (Python 2.7) on your Windows machine and
use that. Then read http://docs.python.org/release/3.2/whatsnew/3.0.html

Regards, Alex
 
P

Peter Otten

Aaron said:
On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting
the following error :-

File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13
except OSError, err:
^

It works okay on my Linux machine running Python 2.6.2.

Many thanks in advance,

Use

try:
...
except OSError as err:
...

This will work in both 2.6 and 3.x. If you are interested in the reasons for
this change see

http://www.python.org/dev/peps/pep-3110/
 
M

MRAB

On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting
the following error :-

File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13
except OSError, err:
^

It works okay on my Linux machine running Python 2.6.2.

Many thanks in advance,

Aaron
In Python 3 the syntax is:

except OSError as err:

Are you sure that that version of OpenGL compatible with Python 3?
 
A

Aaron Gray

Aaron Gray said:
On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting
the following error :-

File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13
except OSError, err:
^

It works okay on my Linux machine running Python 2.6.2.

Many thanks,

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top