summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_autocomplete.py
diff options
context:
space:
mode:
authorFlorian Dahlitz <f2dahlitz@freenet.de>2020-05-24 10:53:44 (GMT)
committerGitHub <noreply@github.com>2020-05-24 10:53:44 (GMT)
commit905b3cd05f8d2c29e1605d109900e3e9d07af4d3 (patch)
treed855083e8104d4e48f8bdc0ebd08effaff45f026 /Lib/idlelib/idle_test/test_autocomplete.py
parentfdc5a94279736a7715dd35c5354a3c27098d0897 (diff)
downloadcpython-905b3cd05f8d2c29e1605d109900e3e9d07af4d3.zip
cpython-905b3cd05f8d2c29e1605d109900e3e9d07af4d3.tar.gz
cpython-905b3cd05f8d2c29e1605d109900e3e9d07af4d3.tar.bz2
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
This was the only failure running unittest.main(test.test_idle) after imports.
Diffstat (limited to 'Lib/idlelib/idle_test/test_autocomplete.py')
-rw-r--r--Lib/idlelib/idle_test/test_autocomplete.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py
index 2c478cd..1841495 100644
--- a/Lib/idlelib/idle_test/test_autocomplete.py
+++ b/Lib/idlelib/idle_test/test_autocomplete.py
@@ -227,7 +227,7 @@ class AutoCompleteTest(unittest.TestCase):
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