File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787
8888import os as _os
8989import re as _re
90- import shutil as _shutil
9190import sys as _sys
9291
9392from gettext import gettext as _ , ngettext
@@ -167,7 +166,8 @@ def __init__(self,
167166
168167 # default setting for width
169168 if width is None :
170- width = _shutil .get_terminal_size ().columns
169+ import shutil
170+ width = shutil .get_terminal_size ().columns
171171 width -= 2
172172
173173 self ._prog = prog
@@ -264,7 +264,7 @@ def add_argument(self, action):
264264 invocations .append (get_invocation (subaction ))
265265
266266 # update the maximum item length
267- invocation_length = max ([ len ( s ) for s in invocations ] )
267+ invocation_length = max (map ( len , invocations ) )
268268 action_length = invocation_length + self ._current_indent
269269 self ._action_max_length = max (self ._action_max_length ,
270270 action_length )
You can’t perform that action at this time.
0 commit comments