Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
a8684984
Commit
a8684984
authored
Mar 26, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace assertions with fixed checks; closes #157.
parent
4dc001f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mitogen/core.py
mitogen/core.py
+6
-4
No files found.
mitogen/core.py
View file @
a8684984
...
...
@@ -108,7 +108,8 @@ class CallError(Error):
def
_unpickle_call_error
(
s
):
assert
type
(
s
)
is
str
and
len
(
s
)
<
10000
if
not
(
type
(
s
)
is
str
and
len
(
s
)
<
10000
):
raise
TypeError
(
'cannot unpickle CallError: bad input'
)
inst
=
CallError
.
__new__
(
CallError
)
Exception
.
__init__
(
inst
,
s
)
return
inst
...
...
@@ -900,9 +901,10 @@ class Context(object):
def
_unpickle_context
(
router
,
context_id
,
name
):
assert
isinstance
(
router
,
Router
)
assert
isinstance
(
context_id
,
(
int
,
long
))
and
context_id
>
0
assert
isinstance
(
name
,
basestring
)
and
len
(
name
)
<
100
if
not
(
isinstance
(
router
,
Router
)
and
isinstance
(
context_id
,
(
int
,
long
))
and
context_id
>
0
and
isinstance
(
name
,
basestring
)
and
len
(
name
)
<
100
):
raise
TypeError
(
'cannot unpickle Context: bad input'
)
return
router
.
context_class
(
router
,
context_id
,
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment