def get_unicode(key): """Look up a environmental variable by key and return a unicode string by decoding the byte string to unicode with utf8.""" if type(key) is not unicode: raise UnicodeError() byte_string = os.environ.get(str(key)) return to_unicode(byte_string)
def get_unicode(key): """Look up a environmental variable by key and return a unicode string by decoding the byte string to unicode with utf8.""" return to_unicode(_get_environmental_variable(key))