]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
frontend: use ConfigParser.read_file() on Python 3
authorAarni Koskela <akx@iki.fi>
Mon, 28 May 2018 09:39:11 +0000 (12:39 +0300)
committerAarni Koskela <akx@iki.fi>
Mon, 28 May 2018 10:01:40 +0000 (13:01 +0300)
babel/messages/frontend.py

index 31fbaa46b182d7d25e532e1acb69ba9a55457600..16cb90054a700c9bddffd734949ac35d62f422a6 100644 (file)
@@ -966,7 +966,12 @@ def parse_mapping(fileobj, filename=None):
 
     parser = RawConfigParser()
     parser._sections = odict(parser._sections)  # We need ordered sections
-    parser.readfp(fileobj, filename)
+
+    if PY2:
+        parser.readfp(fileobj, filename)
+    else:
+        parser.read_file(fileobj, filename)
+
     for section in parser.sections():
         if section == 'extractors':
             extractors = dict(parser.items(section))