error in demo.py

I've compile wxPython without error mensage in Linux (suse 7.1)
When I run python demo.py (python version 2.2) I get de following
error mensage

Traceback (most recent call last):
  File "demo.py", line 4, in ?
    Main.main()
  File "Main.py", line 787, in main
    app = MyApp(wx.Platform == "__WXMAC__")
  File "/usr/lib/python2.2/site-packages/wxPython/wx.py", line 1951, in
__init__
    _wxStart(self.OnInit)
  File "Main.py", line 775, in OnInit
    return True
NameError: global name 'True' is not defined

Zunbeltz Izaola wrote:

I've compile wxPython without error mensage in Linux (suse 7.1)
When I run python demo.py (python version 2.2) I get de following
error mensage
[...]
NameError: global name 'True' is not defined

Try upgrading to the latest bugfix release of Python 2.2 -- IIRC, it's at 2.2.3 now. 2.2.1 introduced the global names True and False, and wxPython is relying on their existence.

Jeff Shannon
Technician/Programmer
Credit International

Zunbeltz Izaola wrote:

I've compile wxPython without error mensage in Linux (suse 7.1)
When I run python demo.py (python version 2.2) I get de following
error mensage

Traceback (most recent call last):
  File "demo.py", line 4, in ?
    Main.main()
  File "Main.py", line 787, in main
    app = MyApp(wx.Platform == "__WXMAC__")
  File "/usr/lib/python2.2/site-packages/wxPython/wx.py", line 1951, in
__init__
    _wxStart(self.OnInit)
  File "Main.py", line 775, in OnInit
    return True
NameError: global name 'True' is not defined

Yep, this has been fixed in CVS already. You can fix it either by upgrading to Python 2.2.2 or newer, or adding the following to demo/Main.py:

try:
     True
except NameError:
     True = 1==1
     False = 1==0

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks for the help. I'm in process of upgrading.

Zunbeltz

···

On Mon, 20 Oct 2003, Jeff Shannon wrote:

Zunbeltz Izaola wrote:

> I've compile wxPython without error mensage in Linux (suse 7.1)
> When I run python demo.py (python version 2.2) I get de following
> error mensage
> [...]
> NameError: global name 'True' is not defined

Try upgrading to the latest bugfix release of Python 2.2 -- IIRC, it's
at 2.2.3 now. 2.2.1 introduced the global names True and False, and
wxPython is relying on their existence.

Jeff Shannon
Technician/Programmer
Credit International

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org