aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/python')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java
index fe9c2b6257..23f19a9b34 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java
@@ -270,11 +270,12 @@ public final class PyCommon {
+ "' need to be converted to Python 2 (not yet implemented)");
}
}
- if (targetVersion == PythonVersion.PY3 || targetVersion == PythonVersion.PY2AND3) {
- if (sourceVersion == PythonVersion.PY2ONLY) {
- ruleContext.ruleError("Rule '" + source
- + "' can only be used with Python 2, and cannot be converted to Python 3");
- }
+ if ((targetVersion == PythonVersion.PY3 || targetVersion == PythonVersion.PY2AND3)
+ && sourceVersion == PythonVersion.PY2ONLY) {
+ ruleContext.ruleError(
+ "Rule '"
+ + source
+ + "' can only be used with Python 2, and cannot be converted to Python 3");
}
}