mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-30 20:18:15 +00:00
Relax logger check for Windows (#1615)
* Relax logger check for Windows * Update tests
This commit is contained in:
parent
61e1060525
commit
a730b9b66a
4 changed files with 10 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ Changelog
|
|||
==========
|
||||
|
||||
|
||||
Release 2.1.0a1 (WIP)
|
||||
Release 2.1.0a2 (WIP)
|
||||
--------------------------
|
||||
|
||||
Breaking Changes:
|
||||
|
|
@ -25,6 +25,7 @@ New Features:
|
|||
|
||||
Bug Fixes:
|
||||
^^^^^^^^^^
|
||||
- Relaxed check in logger, that was causing issue on Windows with colorama
|
||||
|
||||
Deprecations:
|
||||
^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -164,8 +164,10 @@ class HumanOutputFormat(KVWriter, SeqWriter):
|
|||
if isinstance(filename_or_file, str):
|
||||
self.file = open(filename_or_file, "w")
|
||||
self.own_file = True
|
||||
elif isinstance(filename_or_file, TextIOBase):
|
||||
self.file = filename_or_file
|
||||
elif isinstance(filename_or_file, TextIOBase) or hasattr(filename_or_file, "write"):
|
||||
# Note: in theory `TextIOBase` check should be sufficient,
|
||||
# in practice, libraries don't always inherit from it, see GH#1598
|
||||
self.file = filename_or_file # type: ignore[assignment]
|
||||
self.own_file = False
|
||||
else:
|
||||
raise ValueError(f"Expected file or str, got {filename_or_file}")
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.1.0a1
|
||||
2.1.0a2
|
||||
|
|
|
|||
|
|
@ -437,8 +437,9 @@ def test_ep_buffers_stats_window_size(algo, stats_window_size):
|
|||
assert model.ep_success_buffer.maxlen == stats_window_size
|
||||
|
||||
|
||||
def test_human_output_format_custom_test_io():
|
||||
class DummyTextIO(TextIOBase):
|
||||
@pytest.mark.parametrize("base_class", [object, TextIOBase])
|
||||
def test_human_output_format_custom_test_io(base_class):
|
||||
class DummyTextIO(base_class):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.lines = [[]]
|
||||
|
|
|
|||
Loading…
Reference in a new issue