#1858: re-apply patch for this, adding the missing files
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
index d098cb9..0b13c1e 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -343,10 +343,9 @@
             user_filename = "pydistutils.cfg"
 
         # And look for the user config file
-        if 'HOME' in os.environ:
-            user_file = os.path.join(os.environ.get('HOME'), user_filename)
-            if os.path.isfile(user_file):
-                files.append(user_file)
+        user_file = os.path.join(os.path.expanduser('~'), user_filename)
+        if os.path.isfile(user_file):
+            files.append(user_file)
 
         # All platforms support local setup.cfg
         local_file = "setup.cfg"