mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
not use codes
This commit is contained in:
parent
33daa3529f
commit
100226ee9c
@ -4,7 +4,6 @@ implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import codecs
|
|
||||||
from psutil import Process
|
from psutil import Process
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
from time import time
|
from time import time
|
||||||
@ -49,8 +48,8 @@ class Generic(object):
|
|||||||
"""Puts command script to shell history."""
|
"""Puts command script to shell history."""
|
||||||
history_file_name = self._get_history_file_name()
|
history_file_name = self._get_history_file_name()
|
||||||
if os.path.isfile(history_file_name):
|
if os.path.isfile(history_file_name):
|
||||||
with codecs.open(history_file_name, 'a', encoding='utf8') as history:
|
with open(history_file_name, 'a') as history:
|
||||||
history.write(self._get_history_line(command_script))
|
history.write(self._get_history_line(command_script).encode("utf-8"))
|
||||||
|
|
||||||
def _script_from_history(self, line):
|
def _script_from_history(self, line):
|
||||||
"""Returns prepared history line.
|
"""Returns prepared history line.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user