From: Aarni Koskela Date: Mon, 28 May 2018 09:39:11 +0000 (+0300) Subject: frontend: use ConfigParser.read_file() on Python 3 X-Git-Tag: v2.6.0~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c6b3c87749dad880fbfdb0ddfbac4997ef04055;p=thirdparty%2Fbabel.git frontend: use ConfigParser.read_file() on Python 3 --- diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 31fbaa46..16cb9005 100644 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -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))