virt-manager: Drop the DISPLAY error handling

Gtk nowadays doesn't raise an exception, it just exits directly

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-08-29 11:54:40 -04:00
parent c8ed6534e5
commit 2c86eefa5b

View File

@ -74,17 +74,6 @@ def _import_gtk(leftovers):
# This ensures we can init gsettings correctly
from . import config
ignore = config
except Exception as e: # pragma: no cover
# Don't just let the exception raise here. abrt reports bugs
# when users mess up su/sudo and DISPLAY isn't set. Printing
# it avoids the issue
display = os.environ.get("DISPLAY", "")
msg = str(e)
if display:
msg += ": Could not open display: %s" % display
log.debug("".join(traceback.format_exc()))
print(msg)
sys.exit(1)
finally:
sys.argv = origargv