Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
4d42a5fb
Commit
4d42a5fb
authored
2 years ago
by
Manuel Jacob
Browse files
Options
Downloads
Patches
Plain Diff
worker: add docstring to _blockingreader
parent
5d28246b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!168
branching: merge default into stable
,
!125
worker.py improvements
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mercurial/worker.py
+8
-1
8 additions, 1 deletion
mercurial/worker.py
with
8 additions
and
1 deletion
mercurial/worker.py
+
8
−
1
View file @
4d42a5fb
...
...
@@ -69,6 +69,13 @@
class
_blockingreader
:
"""
Wrap unbuffered stream such that pickle.load() works with it.
pickle.load() expects that calls to read() and readinto() read as many
bytes as requested. On EOF, it is fine to read fewer bytes. In this case,
pickle.load() raises an EOFError.
"""
def
__init__
(
self
,
wrapped
):
self
.
_wrapped
=
wrapped
...
...
@@ -94,7 +101,7 @@
def
readline
(
self
):
return
self
.
_wrapped
.
readline
()
# issue multiple reads until size is fulfilled
# issue multiple reads until size is fulfilled
(or EOF is encountered)
def
read
(
self
,
size
=-
1
):
if
size
<
0
:
return
self
.
_wrapped
.
readall
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment