PyGTK is unmaintained and has been archived. It has been superseded by PyGObject. Links below might not work anymore and information below might be incorrect.

Checking if a DISPLAY is set

In PyGTK 2.8.x and earlier you could use the following code to determine if the DISPLAY is set or not:

   1 try:
   2     import gtk
   3 except ImportError, e:
   4     ...

That will not work in PyGTK 2.10 because the ImportError was made into a warning, so instead you'd have to make all warnings raise an exception in gtk module to be able to easily catch this error:

   1 import warnings
   2 warnings.filterwarnings('error', module='gtk')
   3 try:
   4     import gtk
   5 except Warning, e:
   6     print e
   7 warnings.resetwarnings()

ChangeLog

Detailed information about each release

2.9.0

2.9.1

2.9.2

2.9.3

2.9.4

2.9.5

2.9.6

Projects/PyGTK/WhatsNew210 (last edited 2019-01-13 12:16:41 by AndreKlapper)