[projects/pld-ftp-admin] Fix os.environ checks (python3 compat)

baggins baggins at pld-linux.org
Sat Jan 16 20:50:35 CET 2021


commit 16b37c0d83e07e3008251e41dee9093ce92efa1a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Jan 16 20:48:57 2021 +0100

    Fix os.environ checks (python3 compat)

 modules/config.py   | 2 +-
 modules/ftpio.py    | 2 +-
 modules/wwwiface.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/modules/config.py b/modules/config.py
index ee32dfa..0836555 100644
--- a/modules/config.py
+++ b/modules/config.py
@@ -4,7 +4,7 @@ import string, os
 
 value = {}
 
-if os.environ.has_key('HOME'):
+if 'HOME' in os.environ:
     path = os.environ['HOME']
 else:
     path = '../../' # cgi-bin interface
diff --git a/modules/ftpio.py b/modules/ftpio.py
index 5e0132b..2529cee 100644
--- a/modules/ftpio.py
+++ b/modules/ftpio.py
@@ -8,7 +8,7 @@ import config
 
 pubsock=config.value['pubsock']
 
-if os.environ.has_key('HOME'):
+if 'HOME' in os.environ:
     privsock=os.environ['HOME']+'/pld-ftp-admin/var/privsock'
     socketname=privsock
 else:
diff --git a/modules/wwwiface.py b/modules/wwwiface.py
index 12b1a25..4e65630 100644
--- a/modules/wwwiface.py
+++ b/modules/wwwiface.py
@@ -30,7 +30,7 @@ def getopts():
 
     cookies = {}
 
-    if os.environ.has_key('HTTP_COOKIE'):
+    if 'HTTP_COOKIE' in os.environ:
         c = Cookie.SimpleCookie()
         c.load(os.environ['HTTP_COOKIE'])
         for key in c.keys():
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/6c80993a7383e5d7e61a27d16bbad17273632a92



More information about the pld-cvs-commit mailing list