From 919b0a6a7d2bb3faf934d250085877501c60a36f Mon Sep 17 00:00:00 2001 From: boukeversteegh Date: Wed, 3 Jun 2020 23:53:36 +0200 Subject: [PATCH] Check if betterproto has wrapper support in idiomatic way --- betterproto/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/betterproto/plugin.py b/betterproto/plugin.py index 6fc92b6..85557bc 100755 --- a/betterproto/plugin.py +++ b/betterproto/plugin.py @@ -202,7 +202,7 @@ def generate_code(request, response): ) if match_wrapper: wrapped_type = "TYPE_" + match_wrapper.group(1).upper() - if wrapped_type in dir(betterproto): + if hasattr(betterproto, wrapped_type): field_wraps = f"betterproto.{wrapped_type}" map_types = None