summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stub.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/stub.py b/stub.py
index c7ff5fa5..80296f7d 100644
--- a/stub.py
+++ b/stub.py
@@ -48,12 +48,18 @@ if sys.platform == "win32":
import msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
-sys.stdout.write(stdout.decode(sys.stdout.encoding))
+if sys.stdout.encoding:
+ stdout = stdout.decode(sys.stdout.encoding)
+
+sys.stdout.write(stdout)
sys.stdout.flush()
stderr = stderr.strip()
if stderr:
- sys.stderr.write(stderr.decode(sys.stdout.encoding).strip())
+ if sys.stderr.encoding:
+ stderr = stderr.decode(sys.stderr.encoding)
+
+ sys.stderr.write(stderr)
sys.stderr.flush()
sys.exit(extension.returncode)