]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2c.py
python 3 port
[libsigrokdecode.git] / decoders / i2c.py
index c57dd334198ea53ffd1494d435a6a2db1fe5692d..8b8e665e47618535c685c9953ffba07668760ef1 100644 (file)
@@ -319,7 +319,7 @@ class Decoder(sigrok.Decoder):
             duration = self.bitcount * self.period
         else:
             duration = self.period
-        print "**", timeoffset, duration
+        print("**", timeoffset, duration)
         super(Decoder, self).put(timeoffset, duration, output_id, data)
 
     def decode(self, timeoffset, duration, data):
@@ -327,9 +327,9 @@ class Decoder(sigrok.Decoder):
 
         self.timeoffset = timeoffset
         self.duration = duration
-        print "++", timeoffset, duration, len(data)
+        print("++", timeoffset, duration, len(data))
         # duration of one bit in ps, only valid for this call to decode()
-        self.period = duration / len(data)
+        self.period = int(duration / len(data))
 
         # We should accept a list of samples and iterate...
         for sample in sampleiter(data, self.unitsize):