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

Unified Diff: third_party/oauth2client/file.py

Issue 1085893002: Upgrade 3rd packages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: rebase Created 5 years, 8 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
Index: third_party/oauth2client/file.py
diff --git a/third_party/oauth2client/file.py b/third_party/oauth2client/file.py
index 1895f94eac58d0386ce59baa86295d27a8a79ec3..4337fcfd243ee0c1492395c10d955b7acb384cfd 100644
--- a/third_party/oauth2client/file.py
+++ b/third_party/oauth2client/file.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Google Inc.
+# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,12 +21,10 @@ credentials.
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import os
-import stat
import threading
-from anyjson import simplejson
-from client import Storage as BaseStorage
from client import Credentials
+from client import Storage as BaseStorage
class CredentialsFileSymbolicLinkError(Exception):
@@ -92,7 +90,7 @@ class Storage(BaseStorage):
simple version of "touch" to ensure the file has been created.
"""
if not os.path.exists(self._filename):
- old_umask = os.umask(0177)
+ old_umask = os.umask(0o177)
try:
open(self._filename, 'a+b').close()
finally:
@@ -110,7 +108,7 @@ class Storage(BaseStorage):
self._create_file_if_needed()
self._validate_file()
- f = open(self._filename, 'wb')
+ f = open(self._filename, 'w')
f.write(credentials.to_json())
f.close()
@@ -121,4 +119,4 @@ class Storage(BaseStorage):
credentials: Credentials, the credentials to store.
"""
- os.unlink(self._filename)
+ os.unlink(self._filename)

Powered by Google App Engine
This is Rietveld 408576698