mk-toolブログ

エンジニアと家のことをごちゃごちゃと書いてます

【Python】AttributeError: 'UUID' object has no attribute 'get_hex'

概要

以下のエラーが発生したためメモ。

AttributeError: 'UUID' object has no attribute 'get_hex'

解決法

get_hexhexにする。

-        key = self.prefix + uuid.uuid4().get_hex()
+        key = self.prefix + uuid.uuid4().hex