Manual 2to3 fixups.
[cumulus.git] / python / cumulus / config.py
index cf721bf..aeb24ae 100644 (file)
@@ -22,7 +22,12 @@ See the Cumulus documentation for a description of the configuration file
 format.
 """
 
-import ConfigParser
+from __future__ import division, print_function, unicode_literals
+
+try:
+    import configparser
+except ImportError:
+    import ConfigParser as configparser
 import datetime
 import re
 
@@ -41,7 +46,7 @@ def _build_retention_engine(spec):
     for s in spec.split():
         m = class_re.match(s)
         if not m:
-            print "Invalid retain spec:", s
+            print("Invalid retain spec:", s)
             continue
         period = datetime.timedelta()
         classname = m.group(1)
@@ -58,7 +63,7 @@ def _build_retention_engine(spec):
 class CumulusConfig(object):
     def __init__(self, filename):
         """Parse a Cumulus backup configuration from the specified file."""
-        self._config = ConfigParser.RawConfigParser()
+        self._config = configparser.RawConfigParser()
         self._config.readfp(open(filename))
 
     def get_global(self, key):