1 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net) |
1 # Copyright 2017 Virgil Dupras |
2 |
2 |
3 # This software is licensed under the "BSD" License as described in the "LICENSE" file, |
3 # This software is licensed under the "BSD" License as described in the "LICENSE" file, |
4 # which should be included with this package. The terms are also available at |
4 # which should be included with this package. The terms are also available at |
5 # http://www.hardcoded.net/licenses/bsd_license |
5 # http://www.hardcoded.net/licenses/bsd_license |
6 |
6 |
7 from __future__ import unicode_literals |
7 from __future__ import unicode_literals |
8 |
8 |
9 import sys |
9 import sys |
10 if sys.version < '3': |
10 import os |
|
11 |
|
12 PY3 = sys.version_info[0] >= 3 |
|
13 if PY3: |
|
14 text_type = str |
|
15 binary_type = bytes |
|
16 if os.supports_bytes_environ: |
|
17 # environb will be unset under Windows, but then again we're not supposed to use it. |
|
18 environb = os.environb |
|
19 else: |
11 text_type = unicode |
20 text_type = unicode |
12 binary_type = str |
21 binary_type = str |
13 else: |
22 environb = os.environ |
14 text_type = str |
|
15 binary_type = bytes |
|