Explorar o código

Use ConfigParser.read_file if available.

Jelmer Vernooij %!s(int64=8) %!d(string=hai) anos
pai
achega
4b93fbdc0a
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      dulwich/contrib/swift.py

+ 5 - 1
dulwich/contrib/swift.py

@@ -172,7 +172,11 @@ def load_conf(path=None, file=None):
     """
     conf = ConfigParser()
     if file:
-        conf.readfp(file)
+        try:
+            conf.read_file(file, path)
+        except AttributeError:
+            # read_file only exists in Python3
+            conf.readfp(file)
         return conf
     confpath = None
     if not path: