Handle also longs in EncodedSize
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Thu, 24 Oct 2013 05:44:59 +0000 (08:44 +0300)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Thu, 24 Oct 2013 05:44:59 +0000 (08:44 +0300)
generator/nanopb_generator.py

index 0f14a04..aa2c1b3 100755 (executable)
@@ -105,7 +105,7 @@ class EncodedSize:
         self.symbols = symbols
     
     def __add__(self, other):
-        if isinstance(other, int):
+        if isinstance(other, (int, long)):
             return EncodedSize(self.value + other, self.symbols)
         elif isinstance(other, (str, Names)):
             return EncodedSize(self.value, self.symbols + [str(other)])