瀏覽代碼

fix: handle isatty correctly (#18277) (#18278)

sys.stdin can be `None`

[skip ci]

(cherry picked from commit 35ba00a54e)

Co-authored-by: Ankush Menat <ankush@frappe.io>
version-14
mergify[bot] 2 年之前
committed by GitHub
父節點
當前提交
7ce396ea59
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. +1
    -1
      frappe/__init__.py
  2. +1
    -1
      frappe/utils/__init__.py

+ 1
- 1
frappe/__init__.py 查看文件

@@ -453,7 +453,7 @@ def msgprint(
if as_list and type(msg) in (list, tuple):
out.as_list = 1

if sys.stdin.isatty():
if sys.stdin and sys.stdin.isatty():
msg = _strip_html_tags(out.message)

if flags.print_messages and out.message:


+ 1
- 1
frappe/utils/__init__.py 查看文件

@@ -560,7 +560,7 @@ def is_cli() -> bool:
try:
invoked_from_terminal = bool(os.get_terminal_size())
except Exception:
invoked_from_terminal = sys.stdin.isatty()
invoked_from_terminal = sys.stdin and sys.stdin.isatty()
return invoked_from_terminal




Loading…
取消
儲存