projects
/
python3.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f924bcf
)
argparse-no-shutil
author
Matthias Klose
<doko@debian.org>
Sun, 7 Nov 2021 15:47:09 +0000
(15:47 +0000)
committer
Matthias Klose
<doko@debian.org>
Sun, 7 Nov 2021 15:47:09 +0000
(15:47 +0000)
Gbp-Pq: Name argparse-no-shutil.diff
Lib/argparse.py
patch
|
blob
|
history
diff --git
a/Lib/argparse.py
b/Lib/argparse.py
index c66287942816fb3bd97393e1ade636fc734c2fbd..97e4c574d40fbe9c990e05484cacc2a86ed4e979 100644
(file)
--- a/
Lib/argparse.py
+++ b/
Lib/argparse.py
@@
-175,9
+175,12
@@
class HelpFormatter(object):
# default setting for width
if width is None:
- import shutil
- width = shutil.get_terminal_size().columns
- width -= 2
+ try:
+ import shutil as _shutil
+ width = _shutil.get_terminal_size().columns
+ width -= 2
+ except ImportError:
+ width = 70
self._prog = prog
self._indent_increment = indent_increment