Skip to content

Commit 919b0a6

Browse files
Check if betterproto has wrapper support in idiomatic way
1 parent 7ecf3fe commit 919b0a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

betterproto/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def generate_code(request, response):
202202
)
203203
if match_wrapper:
204204
wrapped_type = "TYPE_" + match_wrapper.group(1).upper()
205-
if wrapped_type in dir(betterproto):
205+
if hasattr(betterproto, wrapped_type):
206206
field_wraps = f"betterproto.{wrapped_type}"
207207

208208
map_types = None

0 commit comments

Comments
 (0)