Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename IoManager.make_non_blocking to be private #77

Merged
merged 1 commit into from
Aug 13, 2022
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## dev

**Breaking changes**

- Removed `pygdbmi.IoManager.make_non_blocking` from the public API; it's unrelated and was not meant to be public
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my interpretation but I'm not sure if it's correct (see the PR description).


Other changes

- Fixed a bug where notifications without a payload were not recognized as such
- Invalid octal sequences produced by GDB are left unchanged instead of causing a `UnicodeDecodeError` (#64)

Expand Down
11 changes: 4 additions & 7 deletions pygdbmi/IoManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
import fcntl


__all__ = [
"IoManager",
"make_non_blocking",
]
__all__ = ["IoManager"]


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -68,9 +65,9 @@ def __init__(
self._allow_overwrite_timeout_times = (
self.time_to_check_for_additional_output_sec > 0
)
make_non_blocking(self.stdout)
_make_non_blocking(self.stdout)
if self.stderr:
make_non_blocking(self.stderr)
_make_non_blocking(self.stderr)

def get_gdb_response(
self, timeout_sec: float = DEFAULT_GDB_TIMEOUT_SEC, raise_error_on_timeout=True
Expand Down Expand Up @@ -325,7 +322,7 @@ def _buffer_incomplete_responses(
return (raw_output, buf)


def make_non_blocking(file_obj: io.IOBase):
def _make_non_blocking(file_obj: io.IOBase):
"""make file object non-blocking
Windows doesn't have the fcntl module, but someone on
stack overflow supplied this code as an answer, and it works
Expand Down