def sanitize_output(output):
 if (output is None):
  return ''
 else:
  return output.rstrip('\r\n')

def sanitize_output ( output ) : if ( output is None ) : return '' else : return output . rstrip ( '\r\n' )
sanitize the output string before we pass it to module .