subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1743370 - /subversion/trunk/subversion/tests/cmdline/lock_tests.py
Date Wed, 11 May 2016 14:06:22 GMT
Author: stefan2
Date: Wed May 11 14:06:22 2016
New Revision: 1743370

URL: http://svn.apache.org/viewvc?rev=1743370&view=rev
Log:
Make the lock tests pass with Python 3.

* subversion/tests/cmdline/lock_tests.py
  (enforce_lock): Property comparison uses binary data.
  (lock_invalid_token): Python 3 makes us jump through various hoops to
                        print generic UTF-8 to STDOUT.  There seems to
                        be no 1-line solution that works for py2 as well.

Modified:
    subversion/trunk/subversion/tests/cmdline/lock_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/lock_tests.py?rev=1743370&r1=1743369&r2=1743370&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/lock_tests.py Wed May 11 14:06:22 2016
@@ -356,9 +356,9 @@ def enforce_lock(sbox):
   svntest.actions.set_prop('svn:needs-lock', '      ', mu_path, expected_err)
 
   # Check svn:needs-lock
-  svntest.actions.check_prop('svn:needs-lock', iota_path, ['*'])
-  svntest.actions.check_prop('svn:needs-lock', lambda_path, ['*'])
-  svntest.actions.check_prop('svn:needs-lock', mu_path, ['*'])
+  svntest.actions.check_prop('svn:needs-lock', iota_path, [b'*'])
+  svntest.actions.check_prop('svn:needs-lock', lambda_path, [b'*'])
+  svntest.actions.check_prop('svn:needs-lock', mu_path, [b'*'])
 
   svntest.main.run_svn(None, 'commit',
                        '-m', '', iota_path, lambda_path, mu_path)
@@ -1689,7 +1689,10 @@ def lock_invalid_token(sbox):
   svntest.main.create_python_hook_script(hook_path,
     '# encoding=utf-8\n'
     'import sys\n'
-    'sys.stdout.write("тест")\n'
+    'if sys.version_info < (3, 0):\n'
+    '  sys.stdout.write("тест")\n'
+    'else:\n'
+    '  sys.stdout.buffer.write(("тест").encode("utf-8"))\n'
     'sys.exit(0)\n')
 
   fname = 'iota'



Mime
View raw message