Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
4a3ffb9e
Commit
4a3ffb9e
authored
May 10, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress Py3k resource warnings for sockets.
parent
aec09788
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/ZEO/tests/forker.py
src/ZEO/tests/forker.py
+8
-5
No files found.
src/ZEO/tests/forker.py
View file @
4a3ffb9e
...
...
@@ -284,6 +284,7 @@ def get_port2(test):
except
socket
.
error
as
e
:
if
e
.
args
[
0
]
!=
errno
.
EADDRINUSE
:
raise
s
.
close
()
continue
if
not
(
can_connect
(
port
)
or
can_connect
(
port
+
1
)):
...
...
@@ -296,13 +297,15 @@ def get_port2(test):
def
can_connect
(
port
):
c
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
try
:
try
:
c
.
connect
((
'localhost'
,
port
))
except
socket
.
error
:
return
False
# Perhaps we should check value of error too.
else
:
c
.
close
()
return
True
finally
:
c
.
close
()
def
setUp
(
test
):
ZODB
.
tests
.
util
.
setUp
(
test
)
...
...
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