From 5601839c4565e31405803416c79aecc0db9a40c0 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Mon, 3 Jan 2011 12:27:50 -0800 Subject: [PATCH] python: properly initialize string length on 64bit systems. types.py was initializing max string length to 2^64 - 1 instead of UINT_MAX on 64 bit systems. This commit fixes that problem. --- python/ovs/db/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py index d42ac7fe..a3b6ba70 100644 --- a/python/ovs/db/types.py +++ b/python/ovs/db/types.py @@ -358,7 +358,7 @@ class BaseType(object): elif self.type == StringType: if self.min_length is not None: stmts.append('%s.u.string.minLen = %d;' % (var, self.min_length)) - if self.max_length is not None: + if self.max_length != sys.maxint: stmts.append('%s.u.string.maxLen = %d;' % (var, self.max_length)) elif self.type == UuidType: if self.ref_table is not None: -- 2.30.2