29 lines
716 B
Diff
29 lines
716 B
Diff
From d1c7216c4265c45bcb8b9380b8ad4e5ed69d014e Mon Sep 17 00:00:00 2001
|
|
From: lingsheng <lingsheng@huawei.com>
|
|
Date: Tue, 22 Sep 2020 14:36:55 +0800
|
|
Subject: [PATCH 1/3] Fix crit encode TypeError
|
|
|
|
---
|
|
lib/py/cli.py | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/lib/py/cli.py b/lib/py/cli.py
|
|
index da34302..966dd4e 100755
|
|
--- a/lib/py/cli.py
|
|
+++ b/lib/py/cli.py
|
|
@@ -16,7 +16,10 @@ def inf(opts):
|
|
|
|
def outf(opts):
|
|
if opts['out']:
|
|
- return open(opts['out'], 'w+')
|
|
+ if getattr(opts['func'], '__name__') == 'encode':
|
|
+ return open(opts['out'], 'wb+')
|
|
+ else:
|
|
+ return open(opts['out'], 'w+')
|
|
else:
|
|
return sys.stdout
|
|
|
|
--
|
|
2.23.0
|
|
|