mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-05 21:31:48 +00:00
Fix PythonDataObjectsTests for python 2
Summary: the python2 branch seems erroneous as it expected the object to be both a "String" and "Bytes". Fix the expectation. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17545 llvm-svn: 261901
This commit is contained in:
1 parent
1d180c31f4
commit
5a8453d576
1 file changed
+1
-2
@@ -209,14 +209,13 @@ TEST_F(PythonDataObjectsTest, TestPythonBytes)
|
||||
PyObject *py_bytes = PyBytes_FromString(test_bytes);
|
||||
EXPECT_TRUE(PythonBytes::Check(py_bytes));
|
||||
PythonBytes python_bytes(PyRefType::Owned, py_bytes);
|
||||
EXPECT_EQ(PyObjectType::Bytes, python_bytes.GetObjectType());
|
||||
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
EXPECT_TRUE(PythonString::Check(py_bytes));
|
||||
EXPECT_EQ(PyObjectType::String, python_bytes.GetObjectType());
|
||||
#else
|
||||
EXPECT_FALSE(PythonString::Check(py_bytes));
|
||||
EXPECT_NE(PyObjectType::String, python_bytes.GetObjectType());
|
||||
EXPECT_EQ(PyObjectType::Bytes, python_bytes.GetObjectType());
|
||||
#endif
|
||||
|
||||
llvm::ArrayRef<uint8_t> bytes = python_bytes.GetBytes();
|
||||
|
||||
Reference in new issue
Block a user