From 2ec2cbdfeb25510af47cc5574dc03faa4ab5cd32 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Nov 21 2018 04:02:59 +0000 Subject: Fix deprecation warning on call to ConfigParser.readfp This change would be useful for other projects to suppress lots of deprecation warning messages. Signed-off-by: Chenxiong Qi --- diff --git a/koji/__init__.py b/koji/__init__.py index bc40a98..989a460 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1705,7 +1705,10 @@ def read_config(profile_name, user_config=None): for configFile in configs: f = open(configFile) config = six.moves.configparser.ConfigParser() - config.readfp(f) + if six.PY3: + config.read_file(f) + else: + config.readfp(f) f.close() if config.has_section(profile_name): got_conf = True