diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py
index d02fb7e3a4f2d43d1c9ba714f2dea030c4973da1..95e7c80a44063c6273c9b1d419a202dccc75a5bd 100644
--- a/py/makeqstrdefs.py
+++ b/py/makeqstrdefs.py
@@ -5,7 +5,6 @@ qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'.
 This script works with Python 2.6, 2.7, 3.3 and 3.4.
 """
 
-import sys
 import re
 import argparse
 import os
@@ -15,11 +14,6 @@ import os
 QSTRING_BLACK_LIST = {'NULL', 'number_of', }
 
 
-def debug(message):
-    #sys.stderr.write("%s\n" % message)
-    pass
-
-
 def write_out(fname, output):
     if output:
         fname = fname.replace("/", "__").replace("..", "@@")
@@ -29,7 +23,6 @@ def write_out(fname, output):
 def process_file(f):
     output = []
     last_fname = None
-    outf = None
     for line in f:
         if line and line[0:2] == "# ":
             comp = line.split()