Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Fix #840 (#1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
slozier authored and slide committed Oct 16, 2016
1 parent 3d98947 commit ca9fefa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Languages/IronPython/IronPython/Runtime/ByteArray.cs
Expand Up @@ -521,7 +521,7 @@ public class ByteArray : IList<byte>, ICodeFormattable, IBufferProtocol
if (_bytes.Count != 0) {
int index = find(sep);
if (index == -1) {
obj[0] = this;
obj[0] = CopyThis();
} else {
obj[0] = new ByteArray(_bytes.Substring(0, index));
obj[1] = sep;
Expand Down Expand Up @@ -629,7 +629,7 @@ public class ByteArray : IList<byte>, ICodeFormattable, IBufferProtocol
if (_bytes.Count != 0) {
int index = rfind(sep);
if (index == -1) {
obj[2] = this;
obj[2] = CopyThis();
} else {
obj[0] = new ByteArray(_bytes.Substring(0, index));
obj[1] = new ByteArray(new List<byte>(sep));
Expand Down
12 changes: 6 additions & 6 deletions Languages/IronPython/Tests/test_bytes.py
Expand Up @@ -356,10 +356,10 @@ def test_partition():

x = testType(b'abc')
one, two, three = x.partition(b'd')
if is_ironpython or testType==str: #http://ironpython.codeplex.com/workitem/27906
AreEqual(id(one), id(x))
if testType == bytearray:
Assert(id(one) != id(x))
else:
Assert(id(one)!=id(x))
AreEqual(id(one), id(x))

one, two, three = b''.partition(b'abc')
AreEqual(id(one), id(two))
Expand Down Expand Up @@ -506,10 +506,10 @@ def test_rpartition():

x = testType(b'abc')
one, two, three = x.rpartition(b'd')
if is_ironpython or testType==str: #http://ironpython.codeplex.com/workitem/27906
AreEqual(id(three), id(x))
else:
if testType == bytearray:
Assert(id(three) != id(x))
else:
AreEqual(id(three), id(x))

b = testType(b'mississippi')
AreEqual(b.rpartition(b'i'), (b'mississipp', b'i', b''))
Expand Down

0 comments on commit ca9fefa

Please sign in to comment.