diff --git a/pyipmitest/ipmi_debug.py b/pyipmitest/ipmi_debug.py
index a8b1001..537bb19 100644
--- a/pyipmitest/ipmi_debug.py
+++ b/pyipmitest/ipmi_debug.py
@@ -11,28 +11,32 @@
 import dbus.service
 import dbus.mainloop.glib
 
-DBUS_NAME = 'org.openbmc.HostIpmi'
-OBJ_NAME = '/org/openbmc/HostIpmi/1'
+DBUS_NAME = "org.openbmc.HostIpmi"
+OBJ_NAME = "/org/openbmc/HostIpmi/1"
 
 
 def header(seq, netfn, lun, cmd):
-    return (
-        'seq:   0x%02x\nnetfn: 0x%02x\n\nlun: 0x%02d\ncmd:   0x%02x\n') % (
-            seq, netfn, lun, cmd)
+    return ("seq:   0x%02x\nnetfn: 0x%02x\n\nlun: 0x%02d\ncmd:   0x%02x\n") % (
+        seq,
+        netfn,
+        lun,
+        cmd,
+    )
 
 
 def print_request(seq, netfn, lun, cmd, data):
     str = header(seq, netfn, lun, cmd)
-    str += 'data:  [%s]' % ', '.join(['0x%02x' % x for x in data])
-    print str
+    str += "data:  [%s]" % ", ".join(["0x%02x" % x for x in data])
+    print(str)
 
 
 def print_response(seq, netfn, lun, cmd, cc, data):
     str = header(seq, netfn, lun, cmd)
-    str += 'cc:    0x%02x\ndata:  [%s]' % (
-                cc, ', '.join(['0x%02x' % x for x in data])
-            )
-    print str
+    str += "cc:    0x%02x\ndata:  [%s]" % (
+        cc,
+        ", ".join(["0x%02x" % x for x in data]),
+    )
+    print(str)
 
 
 class IpmiDebug(dbus.service.Object):
@@ -41,23 +45,23 @@
 
     @dbus.service.signal(DBUS_NAME, "yyyyay")
     def ReceivedMessage(self, seq, netfn, lun, cmd, data):
-        print "IPMI packet from host:"
+        print("IPMI packet from host:")
         print_request(seq, netfn, lun, cmd, data)
 
     @dbus.service.method(DBUS_NAME, "yyyyyay", "x")
     def sendMessage(self, seq, netfn, lun, cmd, ccode, data):
-        print "IPMI packet sent to host:"
+        print("IPMI packet sent to host:")
         print_response(seq, netfn, lun, cmd, ccode, data)
         return 0
 
     @dbus.service.method(DBUS_NAME)
     def setAttention(self):
-        print "IPMI SMS_ATN set"
+        print("IPMI SMS_ATN set")
 
 
 class ConsoleReader(object):
     def __init__(self, ipmi_obj):
-        self.buffer = ''
+        self.buffer = ""
         self.seq = 0
         self.ipmi_obj = ipmi_obj
         flags = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL)
@@ -69,16 +73,16 @@
         chunk = fd.read()
         for char in chunk:
             self.buffer += char
-            if char == '\n':
+            if char == "\n":
                 self.line(self.buffer)
-                self.buffer = ''
+                self.buffer = ""
 
         return True
 
     def line(self, data):
-        s = data.split(' ')
+        s = data.split(" ")
         if len(s) < 2:
-            print "Not enough bytes to form a valid IPMI packet"
+            print("Not enough bytes to form a valid IPMI packet")
             return
         try:
             data = [int(c, 16) for c in s]
@@ -98,12 +102,14 @@
     obj.unmask_signals()
     name = dbus.service.BusName(DBUS_NAME, bus)
 
-    print ("Enter IPMI packet as hex values. First three bytes will be used"
-           "as netfn and cmd.\nlun will be zero.")
+    print(
+        "Enter IPMI packet as hex values. First three bytes will be used"
+        "as netfn and cmd.\nlun will be zero."
+    )
     mainloop.run()
 
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     sys.exit(main())
 
 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
