Skip to content

Commit eac9aa3

Browse files
committed
only add a comma for *args and **kwargs when there is an argument in front
1 parent 9e2efc7 commit eac9aa3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bpython/cli.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,15 @@ def mkargspec(self, topline, down):
744744
self.list_win.addstr(', ', curses.color_pair(self._C["g"]+1))
745745

746746
if _args:
747-
self.list_win.addstr(', ',
748-
curses.color_pair(self._C["g"]+1))
747+
if args:
748+
self.list_win.addstr(', ',
749+
curses.color_pair(self._C["g"]+1))
749750
self.list_win.addstr('*%s' % (_args, ),
750751
curses.color_pair(self._C["m"]+1))
751752
if _kwargs:
752-
self.list_win.addstr(', ',
753-
curses.color_pair(self._C["g"]+1))
753+
if args or _args:
754+
self.list_win.addstr(', ',
755+
curses.color_pair(self._C["g"]+1))
754756
self.list_win.addstr('**%s' % (_kwargs, ),
755757
curses.color_pair(self._C["m"]+1))
756758
self.list_win.addstr(')', curses.color_pair(self._C["y"]+1))

0 commit comments

Comments
 (0)