| 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)
|
|
|