summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/llsdserialize_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/tests/llsdserialize_test.cpp')
-rw-r--r--indra/llcommon/tests/llsdserialize_test.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index 642c1c3879..c246f5ee56 100644
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -1795,7 +1795,7 @@ namespace tut
set_test_name("verify NamedTempFile");
python("platform",
"import sys\n"
- "print 'Running on', sys.platform\n");
+ "print('Running on', sys.platform)\n");
}
// helper for test<3>
@@ -1825,14 +1825,14 @@ namespace tut
const char pydata[] =
"def verify(iterable):\n"
" it = iter(iterable)\n"
- " assert it.next() == 17\n"
- " assert abs(it.next() - 3.14) < 0.01\n"
- " assert it.next() == '''\\\n"
+ " assert next(it) == 17\n"
+ " assert abs(next(it) - 3.14) < 0.01\n"
+ " assert next(it) == '''\\\n"
"This string\n"
"has several\n"
"lines.'''\n"
" try:\n"
- " it.next()\n"
+ " next(it)\n"
" except StopIteration:\n"
" pass\n"
" else:\n"
@@ -1855,7 +1855,7 @@ namespace tut
" yield llsd.parse(item)\n" <<
pydata <<
// Don't forget raw-string syntax for Windows pathnames.
- "verify(parse_each(open(r'" << file.getName() << "')))\n");
+ "verify(parse_each(open(r'" << file.getName() << "', 'rb')))\n");
}
template<> template<>
@@ -1870,7 +1870,6 @@ namespace tut
python("write Python notation",
placeholders::arg1 <<
- "from __future__ import with_statement\n" <<
import_llsd <<
"DATA = [\n"
" 17,\n"
@@ -1884,7 +1883,7 @@ namespace tut
// N.B. Using 'print' implicitly adds newlines.
"with open(r'" << file.getName() << "', 'w') as f:\n"
" for item in DATA:\n"
- " print >>f, llsd.format_notation(item)\n");
+ " print(llsd.format_notation(item).decode(), file=f)\n");
std::ifstream inf(file.getName().c_str());
LLSD item;