[projects/pld-ftp-admin] Fix loading StringIO on both python2 and python3

baggins baggins at pld-linux.org
Sun Jan 17 17:08:02 CET 2021


commit 5e91d16664e085bc7d8967bdd8b2e6216bfed6c0
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Jan 17 17:06:50 2021 +0100

    Fix loading StringIO on both python2 and python3

 modules/mailer.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/modules/mailer.py b/modules/mailer.py
index bf13ef5..db85f40 100644
--- a/modules/mailer.py
+++ b/modules/mailer.py
@@ -3,7 +3,10 @@
 import time
 import os
 import sys
-import StringIO
+if sys.version_info[0] == 2:
+    import StringIO
+else:
+    from io import StringIO
 
 import config
 cval=config.value
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/5e91d16664e085bc7d8967bdd8b2e6216bfed6c0



More information about the pld-cvs-commit mailing list