Remove use of sys.exc_value

sys.exc_value is deprecated since Python 1.5, and was removed in Python 3.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Petr Viktorin
2015-08-10 18:00:36 +02:00
committed by Jan Cholasta
parent 7ed51586ca
commit f82463d4e2
3 changed files with 6 additions and 6 deletions

View File

@@ -30,13 +30,13 @@ try:
from ipalib import api, errors from ipalib import api, errors
from ipapython.ipa_log_manager import * from ipapython.ipa_log_manager import *
from ipapython.dn import DN from ipapython.dn import DN
except ImportError: except ImportError as e:
print >> sys.stderr, """\ print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The There was a problem importing one of the required Python modules. The
error was: error was:
%s %s
""" % sys.exc_value """ % e
sys.exit(1) sys.exit(1)
compat_dn = DN(('cn', 'Schema Compatibility'), ('cn', 'plugins'), ('cn', 'config')) compat_dn = DN(('cn', 'Schema Compatibility'), ('cn', 'plugins'), ('cn', 'config'))

View File

@@ -32,13 +32,13 @@ try:
from ipapython.ipa_log_manager import * from ipapython.ipa_log_manager import *
from ipapython.dn import DN from ipapython.dn import DN
from ipaplatform import services from ipaplatform import services
except ImportError: except ImportError as e:
print >> sys.stderr, """\ print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The There was a problem importing one of the required Python modules. The
error was: error was:
%s %s
""" % sys.exc_value """ % e
sys.exit(1) sys.exit(1)
nis_config_dn = DN(('cn', 'NIS Server'), ('cn', 'plugins'), ('cn', 'config')) nis_config_dn = DN(('cn', 'NIS Server'), ('cn', 'plugins'), ('cn', 'config'))

View File

@@ -57,13 +57,13 @@ try:
from ipapython.ssh import SSHPublicKey from ipapython.ssh import SSHPublicKey
from ipalib.rpc import delete_persistent_client_session_data from ipalib.rpc import delete_persistent_client_session_data
except ImportError: except ImportError as e:
print >> sys.stderr, """\ print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The There was a problem importing one of the required Python modules. The
error was: error was:
%s %s
""" % sys.exc_value """ % e
sys.exit(1) sys.exit(1)
SUCCESS = 0 SUCCESS = 0