Skip to content

Commit

Permalink
Merge branch 'main' into fix/replace-repeated-deepcopy-with-attribute…
Browse files Browse the repository at this point in the history
…-lookup
  • Loading branch information
parthea authored May 2, 2022
2 parents 37321e5 + 3148a1c commit 9cc0df0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proto/_package_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ def compile(name, attrs):
# Pull a reference to the module where this class is being
# declared.
module = sys.modules.get(attrs.get("__module__"))
module_name = module.__name__ if hasattr(module, __name__) else ""
proto_module = getattr(module, "__protobuf__", object())

# A package should be present; get the marshal from there.
package = getattr(proto_module, "package", "")
package = getattr(proto_module, "package", module_name)
marshal = Marshal(name=getattr(proto_module, "marshal", package))

# Done; return the data.
Expand Down

0 comments on commit 9cc0df0

Please sign in to comment.