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

Unified Diff: third_party/boto/boto/compat.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month 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/boto/boto/cloudtrail/__init__.py ('k') | third_party/boto/boto/connection.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/boto/compat.py
===================================================================
--- third_party/boto/boto/compat.py (revision 33376)
+++ third_party/boto/boto/compat.py (working copy)
@@ -19,10 +19,23 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
+import os
+
# This allows boto modules to say "from boto.compat import json". This is
# preferred so that all modules don't have to repeat this idiom.
try:
import simplejson as json
except ImportError:
import json
+
+
+# If running in Google App Engine there is no "user" and
+# os.path.expanduser() will fail. Attempt to detect this case and use a
+# no-op expanduser function in this case.
+try:
+ os.path.expanduser('~')
+ expanduser = os.path.expanduser
+except (AttributeError, ImportError):
+ # This is probably running on App Engine.
+ expanduser = (lambda x: x)
« no previous file with comments | « third_party/boto/boto/cloudtrail/__init__.py ('k') | third_party/boto/boto/connection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698