Runtime Error in CUP (CVE-2015-1158) python exploit

M trying to execute following exploit https://www.exploit-db.com/exploits/41233/ against the vulnerable installation of cups however upon compiling m getting following error

root@kali:~./cups_exploit.py -a 10.11.1.8 -b 631 -c /tmp/x86reverseshell.so

[*] locate available printer Traceback (most recent call last):   File 
"./cups_exploit.py", line 524, in <module>
    main()   File "./cups_exploit.py", line 504, in main
    printer = locatePrinters(rhost,rport)    File "./cups_exploit.py", line 
  147, in locatePrinters
    return printer UnboundLocalError: local variable 'printer' referenced 
   before assignment

Can somebody please guide me in direction from where I can trouble shoot this error via research