diff --git a/setup.py b/setup.py
index d12e1773bbb2c36a7f492479824e19e88fc4228a..012de36a5e36670bf169c607d9fd5c08a9bcfc38 100755
--- a/setup.py
+++ b/setup.py
@@ -307,7 +307,7 @@ def extensions():
     config = configparser.ConfigParser()
     try:
         with open(CONFIG_FILE) as f:
-            config.readfp(f)
+            config.read_file(f)
     except IOError:
         config_file_present = False
     else: