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 1a91f04..8720caa 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)