From ad8096b51f1f8de2c05a5c53952fcb2cb5bbd116 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 27 Feb 2008 10:40:18 -0500 Subject: - Centralize try/except so the entire program is covered. This make it possible to catch KeyboardInterrupt during the import process. - Add function for handling python differences with GSSError 434798 --- ipa-python/ipautil.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ipa-python') diff --git a/ipa-python/ipautil.py b/ipa-python/ipautil.py index 4b1feb4c..919d4a6b 100644 --- a/ipa-python/ipautil.py +++ b/ipa-python/ipautil.py @@ -828,3 +828,15 @@ class ItemCompleter: return items +def get_gsserror(e): + """A GSSError exception looks differently in python 2.4 than it does + in python 2.5, deal with it.""" + + try: + primary = e[0] + secondary = e[1] + except: + primary = e[0][0] + secondary = e[0][1] + + return (primary[0], secondary[0]) -- cgit