Skip to content

Commit 722ec8a

Browse files
antocunitomasr8
andauthored
Apply suggestions from code review
Co-authored-by: Tomas R. <[email protected]>
1 parent 157f4b4 commit 722ec8a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/_pyrepl/fancycompleter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ def attr_matches(self, text):
160160
return []
161161

162162
if len(names) == 1:
163-
return ['%s.%s' % (expr, names[0])] # only option, no coloring.
163+
return [f'{expr}.{names[0]}'] # only option, no coloring.
164164

165165
prefix = commonprefix(names)
166166
if prefix and prefix != attr:
167-
return ['%s.%s' % (expr, prefix)] # autocomplete prefix
167+
return [f'{expr}.{prefix}'] # autocomplete prefix
168168

169169
if self.config.use_colors:
170170
return self.colorize_matches(names, values)

Lib/test/test_pyrepl/test_fancycompleter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_complete_function_skipped(self):
180180
def test_unicode_in___dir__(self):
181181
class Foo(object):
182182
def __dir__(self):
183-
return [u'hello', 'world']
183+
return ['hello', 'world']
184184

185185
compl = Completer({'a': Foo()}, ConfigForTest)
186186
matches = compl.attr_matches('a.')

0 commit comments

Comments
 (0)