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
89122706
Commit
89122706
authored
Nov 01, 2014
by
Berker Peksag
Browse files
Options
Browse Files
Download
Plain Diff
Issue #22665: Add missing get_terminal_size and SameFileError to shutil.__all__.
parents
8f791d35
8083cd6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
Lib/shutil.py
Lib/shutil.py
+2
-1
Lib/test/test_shutil.py
Lib/test/test_shutil.py
+18
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/shutil.py
View file @
89122706
...
...
@@ -42,7 +42,8 @@ __all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2",
"register_archive_format"
,
"unregister_archive_format"
,
"get_unpack_formats"
,
"register_unpack_format"
,
"unregister_unpack_format"
,
"unpack_archive"
,
"ignore_patterns"
,
"chown"
,
"which"
]
"ignore_patterns"
,
"chown"
,
"which"
,
"get_terminal_size"
,
"SameFileError"
]
# disk_usage is added later, if available on the platform
class
Error
(
OSError
):
...
...
Lib/test/test_shutil.py
View file @
89122706
...
...
@@ -1788,5 +1788,23 @@ class TermsizeTests(unittest.TestCase):
self
.
assertEqual
(
expected
,
actual
)
class
PublicAPITests
(
unittest
.
TestCase
):
"""Ensures that the correct values are exposed in the public API."""
def
test_module_all_attribute
(
self
):
self
.
assertTrue
(
hasattr
(
shutil
,
'__all__'
))
target_api
=
[
'copyfileobj'
,
'copyfile'
,
'copymode'
,
'copystat'
,
'copy'
,
'copy2'
,
'copytree'
,
'move'
,
'rmtree'
,
'Error'
,
'SpecialFileError'
,
'ExecError'
,
'make_archive'
,
'get_archive_formats'
,
'register_archive_format'
,
'unregister_archive_format'
,
'get_unpack_formats'
,
'register_unpack_format'
,
'unregister_unpack_format'
,
'unpack_archive'
,
'ignore_patterns'
,
'chown'
,
'which'
,
'get_terminal_size'
,
'SameFileError'
]
if
hasattr
(
os
,
'statvfs'
)
or
os
.
name
==
'nt'
:
target_api
.
append
(
'disk_usage'
)
self
.
assertEqual
(
set
(
shutil
.
__all__
),
set
(
target_api
))
if
__name__
==
'__main__'
:
unittest
.
main
()
Misc/NEWS
View file @
89122706
...
...
@@ -180,6 +180,9 @@ Core and Builtins
Library
-------
-
Issue
#
22665
:
Add
missing
get_terminal_size
and
SameFileError
to
shutil
.
__all__
.
-
Issue
#
6623
:
Remove
deprecated
Netrc
class
in
the
ftplib
module
.
Patch
by
Matt
Chaput
.
...
...
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