summaryrefslogtreecommitdiffstats
path: root/src/lib/Options.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-04-27 11:40:08 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-04-27 11:40:08 -0500
commitd3348a34c78ba13d4d4c3e96db19faeeeefac11b (patch)
tree7b36955887357066bb5e5838f5f54f6ff2b518fc /src/lib/Options.py
parent7f68ebb4ce4cb65850a63660f2f1cec06100064a (diff)
downloadbcfg2-d3348a34c78ba13d4d4c3e96db19faeeeefac11b.tar.gz
bcfg2-d3348a34c78ba13d4d4c3e96db19faeeeefac11b.tar.bz2
bcfg2-d3348a34c78ba13d4d4c3e96db19faeeeefac11b.zip
Common: Add full PY3K compatibility
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Options.py')
-rw-r--r--src/lib/Options.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Options.py b/src/lib/Options.py
index 1973e7091..d5304e696 100644
--- a/src/lib/Options.py
+++ b/src/lib/Options.py
@@ -1,11 +1,12 @@
"""Option parsing library for utilities."""
__revision__ = '$Revision$'
-import ConfigParser
import getopt
import os
import sys
import Bcfg2.Client.Tools
+# Compatibility imports
+from Bcfg2.Bcfg2Py3k import ConfigParser
def bool_cook(x):
if x:
@@ -146,7 +147,8 @@ class OptionSet(dict):
try:
opts, args = getopt.getopt(argv, self.buildGetopt(),
self.buildLongGetopt())
- except getopt.GetoptError, err:
+ except getopt.GetoptError:
+ err = sys.exc_info()[1]
self.helpExit(err)
if '-h' in argv:
self.helpExit('', 0)