Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnboundLocalError: "bazel-path for autobazel-attribute looks strange" warning is hit #24

Open
adamtheturtle opened this issue Feb 3, 2021 · 0 comments

Comments

@adamtheturtle
Copy link
Contributor

See the following code

def _handle_attribute(self):
"""Cares about the correct handling of autobazel-attributes"""
attribute_path = self.arguments[0]
try:
package_name, target_name, rule_name, attribute_name = attribute_path.rsplit(':', 3)
except (IndexError, ValueError):
self.log.warning("bazel-path for autobazel-attribute looks strange: {}".format(attribute_path))
if target_name.startswith('/'):

If the except clause is hit, target_name is not set and therefore the startswith check will error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant