Skip to content

Commit 2ebf50e

Browse files
committed
base is never used when calling commonprefix, remove it
1 parent 743e661 commit 2ebf50e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Lib/_pyrepl/fancycompleter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ def color_by_type(self, t):
164164
return getattr(self.theme.fancycompleter, typename, ANSIColors.RESET)
165165

166166

167-
def commonprefix(names, base=''):
168-
"""Return the common prefix of all 'names' starting with 'base'"""
169-
if base:
170-
names = [x for x in names if x.startswith(base)]
167+
def commonprefix(names):
168+
"""Return the common prefix of all 'names'"""
171169
if not names:
172170
return ''
173171
s1 = min(names)

Lib/test/test_pyrepl/test_fancycompleter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ def tearDown(self):
2929
def test_commonprefix(self):
3030
self.assertEqual(commonprefix(['isalpha', 'isdigit', 'foo']), '')
3131
self.assertEqual(commonprefix(['isalpha', 'isdigit']), 'is')
32-
self.assertEqual(commonprefix(['isalpha', 'isdigit', 'foo'], base='i'), 'is')
3332
self.assertEqual(commonprefix([]), '')
34-
self.assertEqual(commonprefix(['aaa', 'bbb'], base='x'), '')
3533

3634
def test_complete_attribute(self):
3735
compl = Completer({'a': None}, use_colors=False)

0 commit comments

Comments
 (0)