Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a619bd5b
Commit
a619bd5b
authored
Dec 17, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added compatibility hacks for Python 0.9.6.
parent
1989409d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
Demo/rpc/rpc.py
Demo/rpc/rpc.py
+15
-4
No files found.
Demo/rpc/rpc.py
View file @
a619bd5b
...
@@ -127,8 +127,13 @@ def make_auth_unix(seed, host, uid, gid, groups):
...
@@ -127,8 +127,13 @@ def make_auth_unix(seed, host, uid, gid, groups):
return
p
.
get_buf
()
return
p
.
get_buf
()
def
make_auth_unix_default
():
def
make_auth_unix_default
():
return
make_auth_unix
(
0
,
socket
.
gethostname
(),
\
try
:
os
.
getuid
(),
os
.
getgid
(),
[])
from
os
import
getuid
,
getgid
uid
=
getuid
()
gid
=
getgid
()
except
ImportError
:
uid
=
gid
=
0
return
make_auth_unix
(
0
,
socket
.
gethostname
(),
uid
,
gid
,
[])
# Common base class for clients
# Common base class for clients
...
@@ -259,7 +264,11 @@ class RawUDPClient(Client):
...
@@ -259,7 +264,11 @@ class RawUDPClient(Client):
p
.
pack_callheader
(
xid
,
self
.
prog
,
self
.
vers
,
proc
,
cred
,
verf
)
p
.
pack_callheader
(
xid
,
self
.
prog
,
self
.
vers
,
proc
,
cred
,
verf
)
def
do_call
(
self
,
*
rest
):
def
do_call
(
self
,
*
rest
):
from
select
import
select
try
:
from
select
import
select
except
ImportError
:
print
'WARNING: select not found, RPC may hang'
select
=
None
if
len
(
rest
)
==
0
:
if
len
(
rest
)
==
0
:
bufsize
=
8192
bufsize
=
8192
elif
len
(
rest
)
>
1
:
elif
len
(
rest
)
>
1
:
...
@@ -271,7 +280,9 @@ class RawUDPClient(Client):
...
@@ -271,7 +280,9 @@ class RawUDPClient(Client):
count
=
5
count
=
5
self
.
sock
.
send
(
call
)
self
.
sock
.
send
(
call
)
while
1
:
while
1
:
r
,
w
,
x
=
select
([
self
.
sock
],
[],
[],
timeout
)
r
,
w
,
x
=
[
self
.
sock
],
[],
[]
if
select
:
r
,
w
,
x
=
select
(
r
,
w
,
x
,
timeout
)
if
self
.
sock
not
in
r
:
if
self
.
sock
not
in
r
:
count
=
count
-
1
count
=
count
-
1
if
count
<
0
:
raise
RuntimeError
,
'timeout'
if
count
<
0
:
raise
RuntimeError
,
'timeout'
...
...
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