From ddd7523012badf249a307166be75dadb233bdbad Mon Sep 17 00:00:00 2001 From: Florian Dahlitz Date: Fri, 22 May 2020 10:27:37 +0200 Subject: [PATCH 1/3] bpo-40723: Make IDLE autocomplete test run without __main__.__file__ --- Lib/idlelib/idle_test/test_autocomplete.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py index 2c478cd5c2a146..1841495fcf1a0c 100644 --- a/Lib/idlelib/idle_test/test_autocomplete.py +++ b/Lib/idlelib/idle_test/test_autocomplete.py @@ -227,7 +227,7 @@ def test_fetch_completions(self): acp = self.autocomplete small, large = acp.fetch_completions( '', ac.ATTRS) - if __main__.__file__ != ac.__file__: + if hasattr(__main__, '__file__') and __main__.__file__ != ac.__file__: self.assertNotIn('AutoComplete', small) # See issue 36405. # Test attributes From fa91cd7fc847f2f87b2a90222e4af6e21bfb667a Mon Sep 17 00:00:00 2001 From: Florian Dahlitz Date: Fri, 22 May 2020 12:53:09 +0200 Subject: [PATCH 2/3] Add news entry --- Lib/idlelib/NEWS.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 46b15234a19c63..2708f0080283e8 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-40723: Make autocomplete test run without `__main__.__file__` +as `__file__` is not defined if run as `__main__`. + bpo-38689: IDLE will no longer freeze when inspect.signature fails when fetching a calltip. From 3d7f6e9b6b8edb51f315dcf53ccc024b3f537872 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 24 May 2020 06:23:04 -0400 Subject: [PATCH 3/3] News items. --- Lib/idlelib/NEWS.txt | 3 +-- Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 2708f0080283e8..b112e8ea293a99 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,8 +3,7 @@ Released on 2020-10-05? ====================================== -bpo-40723: Make autocomplete test run without `__main__.__file__` -as `__file__` is not defined if run as `__main__`. +bpo-40723: Make test_idle pass when run after import. bpo-38689: IDLE will no longer freeze when inspect.signature fails when fetching a calltip. diff --git a/Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst b/Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst new file mode 100644 index 00000000000000..e0de2f9d836688 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst @@ -0,0 +1 @@ +Make test_idle pass when run after import.