Repository: thrift
Updated Branches:
  refs/heads/master dabdf659e -> 07218673b


THRIFT-2757: py - fixed checkIntegerLimits in TProtocol.py

Client: Python
Patch: Bret Curtis

I was applying patch, refactoring method names and profiling method, all at once
and in that commotion code in commit was half refactored. This commit fixes it.


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/07218673
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/07218673
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/07218673

Branch: refs/heads/master
Commit: 07218673b0cd4ff9e90d6c04e4a035a7881962ef
Parents: dabdf65
Author: Konrad Grochowski <[email protected]>
Authored: Thu Oct 9 12:18:25 2014 +0200
Committer: Konrad Grochowski <[email protected]>
Committed: Thu Oct 9 12:18:25 2014 +0200

----------------------------------------------------------------------
 lib/py/src/protocol/TProtocol.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/07218673/lib/py/src/protocol/TProtocol.py
----------------------------------------------------------------------
diff --git a/lib/py/src/protocol/TProtocol.py b/lib/py/src/protocol/TProtocol.py
index e8ee799..311a635 100644
--- a/lib/py/src/protocol/TProtocol.py
+++ b/lib/py/src/protocol/TProtocol.py
@@ -403,16 +403,16 @@ class TProtocolBase:
       writer(val)
 
 def checkIntegerLimits(i, bits):
-    if bits == 8 and (n < -128 or n > 127):
+    if bits == 8 and (i < -128 or i > 127):
         raise TProtocolException(TProtocolException.INVALID_DATA,
                                  "i8 requires -128 <= number <= 127")
-    elif bits == 16 and (n < -32768 or n > 32767):
+    elif bits == 16 and (i < -32768 or i > 32767):
         raise TProtocolException(TProtocolException.INVALID_DATA,
                                  "i16 requires -32768 <= number <= 32767")
-    elif bits == 32 and (n < -2147483648 or n > 2147483647):
+    elif bits == 32 and (i < -2147483648 or i > 2147483647):
         raise TProtocolException(TProtocolException.INVALID_DATA,
                                  "i32 requires -2147483648 <= number <= 
2147483647")
-    elif bits == 64 and (n < -9223372036854775808 or n > 9223372036854775807):
+    elif bits == 64 and (i < -9223372036854775808 or i > 9223372036854775807):
          raise TProtocolException(TProtocolException.INVALID_DATA,
                                   "i64 requires -9223372036854775808 <= number 
<= 9223372036854775807")
 

Reply via email to