Don't use shutil backport on py3
Review Request #10047 — Created June 29, 2018 and submitted
On many distributions (including Fedora and RHEL 7), the backports.shutil package doesn't exist for python 3.x because it's meaningless. Instead of unconditionally including it, use the appropriate import for the python version in use.
Submitted this very review using
rbt post
on python3 with this patch applied.
Description | From | Last Updated |
---|---|---|
E126 continuation line over-indented for hanging indent |
reviewbot | |
Instead of checking the version, how about just a try/except? try: from shutil import get_terminal_size except ImportError: from backports.shutil_get_terminal_size import … |
david | |
Can we call this install_requires instead of runtime_reqs? The "runtime" makes me think that this will actually be computed at … |
david |
- Change Summary:
-
Corrected formatting.
- Commit:
-
37bf520fabe78600b7c83f500a2c47257a4ec6d34ebd93159240ed8ad9515646c67cc7479e3ea153
- Diff:
-
Revision 2 (+17 -8)
Checks run (2 succeeded)
-
-
Instead of checking the version, how about just a try/except?
try: from shutil import get_terminal_size except ImportError: from backports.shutil_get_terminal_size import get_terminal_size
-
Can we call this
install_requires
instead ofruntime_reqs
? The "runtime" makes me think that this will actually be computed at runtime, whereas the list will get evaluated at the time that the package is being built.