From: Douglas Bagnall Date: Thu, 11 Oct 2018 05:31:09 +0000 (+1300) Subject: pytest/dcerpc.integer: force py2 long int without incompatible syntax X-Git-Tag: tdb-1.3.17~1165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1450f2c0fc280c3d01b46333546955cfd9261b7;p=thirdparty%2Fsamba.git pytest/dcerpc.integer: force py2 long int without incompatible syntax Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- diff --git a/python/samba/tests/dcerpc/integer.py b/python/samba/tests/dcerpc/integer.py index 682edc1a67e..42308b657ce 100644 --- a/python/samba/tests/dcerpc/integer.py +++ b/python/samba/tests/dcerpc/integer.py @@ -68,7 +68,13 @@ class IntegerTests(samba.tests.TestCase): def test_long_into_int32(self): s = srvsvc.NetRemoteTODInfo() - s.timezone = 5 + # here we force python2 to convert its 32/64 bit python int into + # an arbitrarily long python long, then reduce the number back + # down to something that would fit in an int anyway. In a pure + # python2 world, you could achieve the same thing by writing + # s.timezone = 5L + # but that is a syntax error in py3. + s.timezone = (5 << 65) >> 65 self.assertEquals(s.timezone, 5) def test_larger_long_int_into_int32(self):