-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: improved if statments for Unicode string support for Windows
Better checking for python version (fix bug with python 4.0.0 which could break unicode strings support) Added checking for OS (unicode support doesn't necessary for other systems)
- Loading branch information
1 parent
1fad283
commit abeafbe
Showing
3 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import sys, codecs; | ||
|
||
if (sys.stdout.encoding != "utf-8"): | ||
if (sys.version_info[0] >= 3) and (sys.version_info[1] >= 7): | ||
if (sys.stdout.encoding != "utf-8" and sys.platform == "win32"): | ||
if (sys.version_info[0] + sys.version_info[1] * 0.1) > 3.7: | ||
sys.stdout.reconfigure(encoding='utf-8') | ||
else: | ||
sys.stdout = codecs.getwriter("utf8")(sys.stdout) | ||
|
||
|
||
if (sys.version_info[0] >= 3) and (sys.version_info[1] >= 7): | ||
print(sys.executable) | ||
if sys.platform == "win32": | ||
if (sys.version_info[0] + sys.version_info[1] * 0.1) > 3.7: | ||
print(sys.executable) | ||
else: | ||
print(sys.executable.decode("cp1251")); | ||
else: | ||
print(sys.executable.decode("cp1251")); | ||
print(sys.executable) |