Merge pull request #107 from linkmauve/patch-1
Update colout.py to remove PY2 global
This commit is contained in:
commit
437e241f2c
1 changed files with 0 additions and 5 deletions
|
|
@ -30,8 +30,6 @@ signal.signal( signal.SIGPIPE, signal.SIG_DFL )
|
||||||
# Global variable(s)
|
# Global variable(s)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
PY2 = sys.version_info.major == 2
|
|
||||||
|
|
||||||
context = {}
|
context = {}
|
||||||
debug = False
|
debug = False
|
||||||
|
|
||||||
|
|
@ -757,9 +755,6 @@ def write(colored, stream = sys.stdout):
|
||||||
"""
|
"""
|
||||||
Write "colored" on sys.stdout, then flush.
|
Write "colored" on sys.stdout, then flush.
|
||||||
"""
|
"""
|
||||||
if PY2: # If Python 2.x: force unicode
|
|
||||||
if isinstance(colored, unicode):
|
|
||||||
colored = colored.encode('utf-8')
|
|
||||||
try:
|
try:
|
||||||
stream.write(colored)
|
stream.write(colored)
|
||||||
stream.flush()
|
stream.flush()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue