From 2a57dd211e01c4fe5e8000490c701ce466b8f288 Mon Sep 17 00:00:00 2001 From: Matheus Alcantara Date: Mon, 22 Jul 2019 12:52:04 -0300 Subject: [PATCH] fix: ~/.gpyhistory: no such file or directory Now when the ~/.gpyhistory file does not exist, do not show the error message in the repl, as long as this does not disrupt the experience in the repl. Fixes go-python/gpython#62. --- repl/cli/cli.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repl/cli/cli.go b/repl/cli/cli.go index f7618ea9..2e1da88a 100644 --- a/repl/cli/cli.go +++ b/repl/cli/cli.go @@ -126,7 +126,9 @@ func RunREPL() { defer rl.Close() err := rl.ReadHistory() if err != nil { - fmt.Printf("Failed to open history: %v\n", err) + if !os.IsNotExist(err) { + fmt.Printf("Failed to open history: %v\n", err) + } } for {