ThirdParty/Send2Trash/send2trash/compat.py

changeset 5994
cf0b37d2a28d
parent 4555
861e1741985c
diff -r 4b2b9be7de14 -r cf0b37d2a28d ThirdParty/Send2Trash/send2trash/compat.py
--- a/ThirdParty/Send2Trash/send2trash/compat.py	Sat Nov 25 13:49:54 2017 +0100
+++ b/ThirdParty/Send2Trash/send2trash/compat.py	Thu Nov 30 17:00:18 2017 +0100
@@ -1,15 +1,22 @@
-# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
+# Copyright 2017 Virgil Dupras
 
-# This software is licensed under the "BSD" License as described in the "LICENSE" file, 
-# which should be included with this package. The terms are also available at 
+# This software is licensed under the "BSD" License as described in the "LICENSE" file,
+# which should be included with this package. The terms are also available at
 # http://www.hardcoded.net/licenses/bsd_license
 
 from __future__ import unicode_literals
 
 import sys
-if sys.version < '3':
+import os
+
+PY3 = sys.version_info[0] >= 3
+if PY3:
+    text_type = str
+    binary_type = bytes
+    if os.supports_bytes_environ:
+        # environb will be unset under Windows, but then again we're not supposed to use it.
+        environb = os.environb
+else:
     text_type = unicode
     binary_type = str
-else:
-    text_type = str
-    binary_type = bytes
+    environb = os.environ

eric ide

mercurial