Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ repos:
(?x)^(
.*cs.meta|
.*.css|
.*.meta
.*.meta|
.*.asset|
.*.prefab|
.*.unity|
.*.json
)$
args: [--fix=lf]
args: [--fix=crlf]

- id: trailing-whitespace
name: trailing-whitespace-markdown
Expand Down
4 changes: 2 additions & 2 deletions ml-agents/mlagents/trainers/subprocess_env_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
UnityCommunicatorStoppedException,
)
from multiprocessing import Process, Pipe, Queue
from multiprocessing.connection import Connection
from multiprocessing.connection import Connection, PipeConnection
from queue import Empty as EmptyQueueException
from mlagents_envs.base_env import BaseEnv, BehaviorName, BehaviorSpec
from mlagents_envs import logging_util
Expand Down Expand Up @@ -77,7 +77,7 @@ class StepResponse(NamedTuple):


class UnityEnvWorker:
def __init__(self, process: Process, worker_id: int, conn: Connection):
def __init__(self, process: Process, worker_id: int, conn: PipeConnection):
self.process = process
self.worker_id = worker_id
self.conn = conn
Expand Down
7 changes: 3 additions & 4 deletions utils/generate_markdown_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import argparse
import hashlib


# pydoc-markdown -I . -m module_name --render_toc > doc.md


Expand Down Expand Up @@ -52,8 +51,8 @@ def remove_trailing_whitespace(filename):
# compare source and destination and write only if changed
if source_file != destination_file:
num_changed += 1
with open(filename, "wb") as f:
f.write(destination_file.encode())
with open(filename, "w", newline="\r\n") as f:
f.write(destination_file)


if __name__ == "__main__":
Expand Down Expand Up @@ -84,7 +83,7 @@ def remove_trailing_whitespace(filename):
for submodule in submodules:
module_args.append("-m")
module_args.append(f"{module_name}.{submodule}")
with open(output_file_name, "w") as output_file:
with open(output_file_name, "wb") as output_file:
subprocess_args = [
"pydoc-markdown",
"-I",
Expand Down