mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
Making windows happy
This commit is contained in:
parent
0d29804ab8
commit
1b5337e4d4
@ -1,6 +1,7 @@
|
|||||||
import collections
|
import collections
|
||||||
import os
|
import os
|
||||||
import typing
|
import typing
|
||||||
|
import atexit
|
||||||
|
|
||||||
from mitmproxy import command
|
from mitmproxy import command
|
||||||
from mitmproxy import ctx
|
from mitmproxy import ctx
|
||||||
@ -28,6 +29,12 @@ class CommandHistory:
|
|||||||
for l in _history_lines:
|
for l in _history_lines:
|
||||||
self.add_command(l.strip())
|
self.add_command(l.strip())
|
||||||
|
|
||||||
|
atexit.register(self.cleanup)
|
||||||
|
|
||||||
|
def cleanup(self):
|
||||||
|
if self.command_history_file:
|
||||||
|
self.command_history_file.close()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def last_filtered_index(self):
|
def last_filtered_index(self):
|
||||||
return len(self.filtered_commands) - 1
|
return len(self.filtered_commands) - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user