diff options
author | Masood Malekghassemi <atash@google.com> | 2016-12-14 18:42:03 -0800 |
---|---|---|
committer | Masood Malekghassemi <atash@google.com> | 2016-12-14 18:42:03 -0800 |
commit | 4682bf392860f3b77351cf7221d04b20a656c68a (patch) | |
tree | 6eacc185dda8946aa48bfc3367c0343a7ee65494 /src/python | |
parent | 5e43db8d8f1036904ca1343f4499a20f7188e7c4 (diff) |
Diagnose AttrErr as too-old setuptools
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/grpcio/support.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/python/grpcio/support.py b/src/python/grpcio/support.py index f363f5fdc5..b226e690fd 100644 --- a/src/python/grpcio/support.py +++ b/src/python/grpcio/support.py @@ -100,9 +100,15 @@ def diagnose_compile_error(build_ext, error): .format(source) ) +def diagnose_attribute_error(build_ext, error): + if any('_needs_stub' in arg for arg in error.args): + raise commands.CommandError( + "We expect a missing `_needs_stub` attribute from older versions of " + "setuptools. Consider upgrading setuptools.") _ERROR_DIAGNOSES = { - errors.CompileError: diagnose_compile_error + errors.CompileError: diagnose_compile_error, + AttributeError: diagnose_attribute_error } def diagnose_build_ext_error(build_ext, error, formatted): |