]> git.phdru.name Git - dotfiles.git/commitdiff
init.py: Hide errors during `.write_history_file()`
authorOleg Broytman <phd@phdru.name>
Tue, 23 Apr 2019 13:39:30 +0000 (16:39 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 23 Apr 2019 13:39:30 +0000 (16:39 +0300)
lib/python/init.py

index 1a91f049395ecceb52dee640983f53d3b18cedd2..8720caa9bf1120075310a8a54296704b47e7332b 100644 (file)
@@ -64,7 +64,10 @@ def init():
                 histfile = histfiles[-1]
                 histfile = os.path.expandvars(histfile)
                 histfile = os.path.expanduser(histfile)
-                readline.write_history_file(histfile)
+                try:
+                    readline.write_history_file(histfile)
+                except IOError:
+                    pass
 
             import atexit
             atexit.register(savehist)