Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
re6stnet
Commits
db72be19
Commit
db72be19
authored
9 months ago
by
Tom Niget
Committed by
Tom Niget
8 months ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: stop using deprecated getargspec for rpc
parent
fbb02c65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
re6st/registry.py
re6st/registry.py
+5
-7
No files found.
re6st/registry.py
View file @
db72be19
...
...
@@ -35,13 +35,11 @@ RENEW_PERIOD = 30 * 86400
BABEL_HMAC
=
'babel_hmac0'
,
'babel_hmac1'
,
'babel_hmac2'
def
rpc
(
f
):
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
f
)
assert
not
(
varargs
or
varkw
),
f
if
not
defaults
:
defaults
=
()
i
=
len
(
args
)
-
len
(
defaults
)
f
.
getcallargs
=
eval
(
"lambda %s: locals()"
%
','
.
join
(
args
[
1
:
i
]
+
list
(
map
(
"%s=%r"
.
__mod__
,
list
(
zip
(
args
[
i
:],
defaults
))))))
argspec
=
inspect
.
getfullargspec
(
f
)
assert
not
(
argspec
.
varargs
or
argspec
.
varkw
),
f
sig
=
inspect
.
signature
(
f
)
sig
=
sig
.
replace
(
parameters
=
[
*
sig
.
parameters
.
values
()][
1
:],
return_annotation
=
inspect
.
Signature
.
empty
)
f
.
getcallargs
=
eval
(
"lambda %s: locals()"
%
str
(
sig
)[
1
:
-
1
])
return
f
def
rpc_private
(
f
):
...
...
This diff is collapsed.
Click to expand it.
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