[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Straw-devel] module_check in setup.py
From: |
Terje Rosten |
Subject: |
Re: [Straw-devel] module_check in setup.py |
Date: |
Tue, 20 Jan 2004 09:03:36 +0100 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
* Juri Pakaste
|
| This is caused by import gtk causing a RuntimeError when there's no
| X display.
What about this patch? If the $DISPLAY variable is not set, define it
and then try to import the modules.
- Terje
--- setup.py~ 2004-01-20 08:50:21.000000000 +0100
+++ setup.py 2004-01-20 08:53:41.000000000 +0100
@@ -4,6 +4,7 @@
#
#
+import os
import sys
import glob
import os.path
@@ -21,6 +22,12 @@
def modules_check():
'''Check if necessary modules is installed.
The function is executed by distutils (by the install command).'''
+
+
+ # Some modules fails if the DISPLAY variable is not set.
+ if not os.environ.get('DISPLAY', 0):
+ os.environ['DISPLAY'] = ':0.0'
+
try:
import pygtk
pygtk.require('2.0')