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
3265344a
Commit
3265344a
authored
Feb 03, 2015
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23358: Add missing BaseServer entry to socketserver.__all__.
Patch by Martin Panter.
parent
c057c385
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
Lib/socketserver.py
Lib/socketserver.py
+4
-4
Lib/test/test_socketserver.py
Lib/test/test_socketserver.py
+12
-7
No files found.
Lib/socketserver.py
View file @
3265344a
...
...
@@ -138,10 +138,10 @@ try:
except
ImportError
:
import
dummy_threading
as
threading
__all__
=
[
"
TCPServer"
,
"UDPServer"
,
"ForkingUDPServer"
,
"ForkingTC
PServer"
,
"
ThreadingUDPServer"
,
"ThreadingTCPServer"
,
"BaseRequestHandl
er"
,
"
StreamRequestHandler"
,
"Datagr
amRequestHandler"
,
"ThreadingMixIn"
,
"ForkingMixIn"
]
__all__
=
[
"
BaseServer"
,
"TCPServer"
,
"UDPServer"
,
"ForkingUD
PServer"
,
"
ForkingTCPServer"
,
"ThreadingUDPServer"
,
"ThreadingTCPServ
er"
,
"
BaseRequestHandler"
,
"Stre
amRequestHandler"
,
"
DatagramRequestHandler"
,
"
ThreadingMixIn"
,
"ForkingMixIn"
]
if
hasattr
(
socket
,
"AF_UNIX"
):
__all__
.
extend
([
"UnixStreamServer"
,
"UnixDatagramServer"
,
"ThreadingUnixStreamServer"
,
...
...
Lib/test/test_socketserver.py
View file @
3265344a
...
...
@@ -2,7 +2,6 @@
Test suite for socketserver.
"""
import
_imp
as
imp
import
contextlib
import
os
import
select
...
...
@@ -313,12 +312,18 @@ class SocketServerTest(unittest.TestCase):
socketserver
.
StreamRequestHandler
)
def
test_main
():
if
imp
.
lock_held
():
# If the import lock is held, the threads will hang
raise
unittest
.
SkipTest
(
"can't run when import lock is held"
)
class
MiscTestCase
(
unittest
.
TestCase
):
def
test_all
(
self
):
# objects defined in the module should be in __all__
expected
=
[]
for
name
in
dir
(
socketserver
):
if
not
name
.
startswith
(
'_'
):
mod_object
=
getattr
(
socketserver
,
name
)
if
getattr
(
mod_object
,
'__module__'
,
None
)
==
'socketserver'
:
expected
.
append
(
name
)
self
.
assertCountEqual
(
socketserver
.
__all__
,
expected
)
test
.
support
.
run_unittest
(
SocketServerTest
)
if
__name__
==
"__main__"
:
test_
main
()
unittest
.
main
()
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