Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: third_party/protobuf/examples/list_people.py

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/protobuf/examples/add_person.py ('k') | third_party/protobuf/generate_descriptor_proto.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/examples/list_people.py
diff --git a/third_party/protobuf/examples/list_people.py b/third_party/protobuf/examples/list_people.py
index 755de901a5a27aeccf42c02f6c90ed7a49dbb860..f131872d841ed49fd34addee63ceeb17b788b21f 100755
--- a/third_party/protobuf/examples/list_people.py
+++ b/third_party/protobuf/examples/list_people.py
@@ -31,8 +31,7 @@ if len(sys.argv) != 2:
address_book = addressbook_pb2.AddressBook()
# Read the existing address book.
-f = open(sys.argv[1], "rb")
-address_book.ParseFromString(f.read())
-f.close()
+with open(sys.argv[1], "rb") as f:
+ address_book.ParseFromString(f.read())
ListPeople(address_book)
« no previous file with comments | « third_party/protobuf/examples/add_person.py ('k') | third_party/protobuf/generate_descriptor_proto.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698