Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0fe4513d
Unverified
Kaydet (Commit)
0fe4513d
authored
Mar 24, 2019
tarafından
Terry Jan Reedy
Kaydeden (comit)
GitHub
Mar 24, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36405: IDLE - Restore __main__ and add tests (#12518)
Fix error in commit
2b751555
noticed by Serhiy Storchaka.
üst
6661c172
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
10 deletions
+18
-10
NEWS.txt
Lib/idlelib/NEWS.txt
+1
-1
autocomplete.py
Lib/idlelib/autocomplete.py
+5
-3
calltip.py
Lib/idlelib/calltip.py
+3
-2
test_autocomplete.py
Lib/idlelib/idle_test/test_autocomplete.py
+8
-3
2019-03-23-01-45-56.bpo-36405.m7Wv1F.rst
...NEWS.d/next/IDLE/2019-03-23-01-45-56.bpo-36405.m7Wv1F.rst
+1
-1
No files found.
Lib/idlelib/NEWS.txt
Dosyayı görüntüle @
0fe4513d
...
...
@@ -3,7 +3,7 @@ Released on 2019-10-20?
======================================
bpo-36405: Use dict unpacking in idlelib
and remove unneeded __main__ imports
.
bpo-36405: Use dict unpacking in idlelib.
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight().
This param was only used twice and changed the return type.
...
...
Lib/idlelib/autocomplete.py
Dosyayı görüntüle @
0fe4513d
...
...
@@ -3,6 +3,7 @@
Either on demand or after a user-selected delay after a key character,
pop up a list of candidates.
"""
import
__main__
import
os
import
string
import
sys
...
...
@@ -181,7 +182,8 @@ class AutoComplete:
else
:
if
mode
==
COMPLETE_ATTRIBUTES
:
if
what
==
""
:
namespace
=
{
**
__builtins__
.
__dict__
,
**
globals
()}
namespace
=
{
**
__main__
.
__builtins__
.
__dict__
,
**
__main__
.
__dict__
}
bigl
=
eval
(
"dir()"
,
namespace
)
bigl
.
sort
()
if
"__all__"
in
bigl
:
...
...
@@ -216,8 +218,8 @@ class AutoComplete:
return
smalll
,
bigl
def
get_entity
(
self
,
name
):
"Lookup name in a namespace spanning sys.modules and
globals()
."
return
eval
(
name
,
{
**
sys
.
modules
,
**
globals
()
})
"Lookup name in a namespace spanning sys.modules and
__main.dict__
."
return
eval
(
name
,
{
**
sys
.
modules
,
**
__main__
.
__dict__
})
AutoComplete
.
reload
()
...
...
Lib/idlelib/calltip.py
Dosyayı görüntüle @
0fe4513d
...
...
@@ -4,6 +4,7 @@ Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import
__main__
import
inspect
import
re
import
sys
...
...
@@ -99,10 +100,10 @@ class Calltip:
def
get_entity
(
expression
):
"""Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and
globals()
.
in a namespace spanning sys.modules and
__main.dict__
.
"""
if
expression
:
namespace
=
{
**
sys
.
modules
,
**
globals
()
}
namespace
=
{
**
sys
.
modules
,
**
__main__
.
__dict__
}
try
:
return
eval
(
expression
,
namespace
)
# Only protect user code.
except
BaseException
:
...
...
Lib/idlelib/idle_test/test_autocomplete.py
Dosyayı görüntüle @
0fe4513d
...
...
@@ -3,6 +3,7 @@
import
unittest
from
test.support
import
requires
from
tkinter
import
Tk
,
Text
import
__main__
import
idlelib.autocomplete
as
ac
import
idlelib.autocomplete_w
as
acw
...
...
@@ -35,7 +36,7 @@ class AutoCompleteTest(unittest.TestCase):
del
cls
.
root
def
setUp
(
self
):
self
.
editor
.
text
.
delete
(
'1.0'
,
'end'
)
self
.
text
.
delete
(
'1.0'
,
'end'
)
self
.
autocomplete
=
ac
.
AutoComplete
(
self
.
editor
)
def
test_init
(
self
):
...
...
@@ -132,12 +133,16 @@ class AutoCompleteTest(unittest.TestCase):
# a small list containing non-private variables.
# For file completion, a large list containing all files in the path,
# and a small list containing files that do not start with '.'
pass
small
,
large
=
self
.
autocomplete
.
fetch_completions
(
''
,
ac
.
COMPLETE_ATTRIBUTES
)
self
.
assertLess
(
len
(
small
),
len
(
large
))
if
__main__
.
__file__
!=
ac
.
__file__
:
self
.
assertNotIn
(
'AutoComplete'
,
small
)
# See issue 36405.
def
test_get_entity
(
self
):
# Test that a name is in the namespace of sys.modules and
# __main__.__dict__
pass
self
.
assertEqual
(
self
.
autocomplete
.
get_entity
(
'int'
),
int
)
if
__name__
==
'__main__'
:
...
...
Misc/NEWS.d/next/IDLE/2019-03-23-01-45-56.bpo-36405.m7Wv1F.rst
Dosyayı görüntüle @
0fe4513d
Use dict unpacking in idlelib
and remove unneeded __main__ imports
.
Use dict unpacking in idlelib.
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