Skip to content

Commit

Permalink
Merge pull request beeware#691 from whydoubt/typeerror_3_5_4
Browse files Browse the repository at this point in the history
Handle TypeError fixes backported to Python 3.5.4
  • Loading branch information
freakboy3742 authored Nov 5, 2017
2 parents 6acc30b + 1f4f2be commit ff5bbb9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/common/org/python/types/ByteArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public org.python.Object __add__(org.python.Object other) {
System.arraycopy(other_bytes, 0, new_bytes, this.value.length, other_bytes.length);
return new ByteArray(new_bytes);
}
if (org.Python.VERSION < 0x03060200) {
if (org.Python.VERSION < 0x03050400 || (org.Python.VERSION >= 0x03060000 && org.Python.VERSION < 0x03060200)) {
throw new org.python.exceptions.TypeError("can't concat " + this.typeName() + " to " + other.typeName());
} else {
throw new org.python.exceptions.TypeError("can't concat " + other.typeName() + " to " + this.typeName());
Expand All @@ -259,7 +259,7 @@ public org.python.Object __iadd__(org.python.Object other) {
try {
return super.__iadd__(other);
} catch (org.python.exceptions.TypeError ae) {
if (org.Python.VERSION < 0x03060200) {
if (org.Python.VERSION < 0x03050400 || (org.Python.VERSION >= 0x03060000 && org.Python.VERSION < 0x03060200)) {
throw new org.python.exceptions.TypeError("can't concat " + other.typeName() + " to " + this.typeName());
} else {
throw ae;
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/types/Bytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public org.python.Object __add__(org.python.Object other) {
System.arraycopy(other_bytes, 0, new_bytes, this.value.length, other_bytes.length);
return new Bytes(new_bytes);
}
if (org.Python.VERSION < 0x03060200) {
if (org.Python.VERSION < 0x03050400 || (org.Python.VERSION >= 0x03060000 && org.Python.VERSION < 0x03060200)) {
throw new org.python.exceptions.TypeError("can't concat bytes to " + other.typeName());
} else {
throw new org.python.exceptions.TypeError("can't concat " + other.typeName() + " to bytes");
Expand Down

0 comments on commit ff5bbb9

Please sign in to comment.