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:
97c8845
)
argparse-no-shutil
author
Matthias Klose
<doko@debian.org>
Thu, 17 Mar 2022 07:20:01 +0000
(07:20 +0000)
committer
Matthias Klose
<doko@debian.org>
Thu, 17 Mar 2022 07:20:01 +0000
(07:20 +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 d022c50adaa62b88b7216cb07a4a0692c1208eda..40792f6bd1b79ba98c4d747a7368159acb8688a1 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