Index

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 2013-11-22 23:49:33 by WilliamJonMcCann)