From 4c55093f6a2493abb1c3fdf8d5b7e942eb8ea121 Mon Sep 17 00:00:00 2001 From: slush0 Date: Thu, 9 Jan 2014 17:33:58 +0100 Subject: [PATCH] pb2json allow extra fields to merge with --- trezorlib/protobuf_json.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/trezorlib/protobuf_json.py b/trezorlib/protobuf_json.py index 146468efab..2704fef6c9 100644 --- a/trezorlib/protobuf_json.py +++ b/trezorlib/protobuf_json.py @@ -76,9 +76,8 @@ def json2pb(pb, js): -def pb2json(pb): +def pb2json(pb, js={}): ''' convert google.protobuf.descriptor instance to JSON string ''' - js = {} # fields = pb.DESCRIPTOR.fields #all fields fields = pb.ListFields() # only filled (including extensions) for field, value in fields: