def get_module_attribute(module_name, attr_name):
 attr_value_if_undefined = '!)ABadCafe@(D15ea5e#*DeadBeef$&Fee1Dead%^'
 attr_value = exec_statement(('\n        import %s as m\n        print(getattr(m, %r, %r))\n    ' % (module_name, attr_name, attr_value_if_undefined)))
 if (attr_value == attr_value_if_undefined):
  raise AttributeError(('Module %r has no attribute %r' % (module_name, attr_name)))
 else:
  return attr_value

def get_module_attribute ( module_name , attr_name ) : attr_value_if_undefined = '!)ABadCafe@(D15ea5e#*DeadBeef$&Fee1Dead%^' attr_value = exec_statement ( ( '\n        import %s as m\n        print(getattr(m, %r, %r))\n    ' % ( module_name , attr_name , attr_value_if_undefined ) ) ) if ( attr_value == attr_value_if_undefined ) : raise AttributeError ( ( 'Module %r has no attribute %r' % ( module_name , attr_name ) ) ) else : return attr_value
get the string value of the passed attribute from the passed module if this attribute is defined by this module _or_ raise attributeerror otherwise .