--- DistUtilsExtra/auto.py.dont_import_gtk 2010-09-16 19:31:55.000000000 +0200 +++ DistUtilsExtra/auto.py 2011-03-15 12:31:30.640351745 +0100 @@ -335,7 +335,10 @@ for node in ast.walk(tree): if isinstance(node, ast.Import): for alias in node.names: - if __external_mod(alias.name, attrs): + # do not attempt to test if 'gtk' is an external module + # since doing so will fail if no DISPLAY is available + # e.g. on RPM builders or remote servers without X forwarding + if alias.name == 'gtk' or __external_mod(alias.name, attrs): imports.add(alias.name) if isinstance(node, ast.ImportFrom): if __external_mod(node.module, attrs):