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
78d915aa
Commit
78d915aa
authored
Sep 09, 2015
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 24199: Deprecate idlelib.idlever with a warning on import.
parent
bf19d169
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
Lib/idlelib/idle_test/test_warning.py
Lib/idlelib/idle_test/test_warning.py
+9
-0
Lib/idlelib/idlever.py
Lib/idlelib/idlever.py
+10
-3
No files found.
Lib/idlelib/idle_test/test_warning.py
View file @
78d915aa
...
...
@@ -68,6 +68,15 @@ class ShellWarnTest(unittest.TestCase):
'Test'
,
UserWarning
,
'test_warning.py'
,
99
,
f
,
'Line of code'
)
self
.
assertEqual
(
shellmsg
.
splitlines
(),
f
.
getvalue
().
splitlines
())
class
ImportWarnTest
(
unittest
.
TestCase
):
def
test_idlever
(
self
):
with
warnings
.
catch_warnings
(
record
=
True
)
as
w
:
warnings
.
simplefilter
(
"always"
)
import
idlelib.idlever
self
.
assertEqual
(
len
(
w
),
1
)
self
.
assertTrue
(
issubclass
(
w
[
-
1
].
category
,
DeprecationWarning
))
self
.
assertIn
(
"version"
,
str
(
w
[
-
1
].
message
))
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
,
exit
=
False
)
Lib/idlelib/idlever.py
View file @
78d915aa
"""Unused by Idle: there is no separate Idle version anymore.
Kept only for possible existing extension use."""
"""
The separate Idle version was eliminated years ago;
idlelib.idlever is no longer used by Idle
and will be removed in 3.6 or later. Use
from sys import version
IDLE_VERSION = version[:version.index(' ')]
"""
# Kept for now only for possible existing extension use
import
warnings
as
w
w
.
warn
(
__doc__
,
DeprecationWarning
)
from
sys
import
version
IDLE_VERSION
=
version
[:
version
.
index
(
' '
)]
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