From: Albert Dengg Date: Fri, 26 Mar 2010 13:04:13 +0000 (+0100) Subject: work for python 2.5 X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=f4fd8130cafbf260c70ea57916713527a6516757;p=cumulus.git work for python 2.5 * import "with" statement from __future__ to be able to use it in 2.5 --- diff --git a/python/cumulus/store/sftp.py b/python/cumulus/store/sftp.py index de77b64..7ea8815 100644 --- a/python/cumulus/store/sftp.py +++ b/python/cumulus/store/sftp.py @@ -7,6 +7,12 @@ import os, os.path import getpass import re import sys +#needed for python 2.5 +try: + from __future__ import with_statement +except ImportError, e: + raise ImportError('We need the "with" statement, avalible with python >=2.5') + class SSHHostConfig(dict): def __init__(self, hostname, user = None, filename = None):