~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/ftp_server/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
Facilities to use ftp test servers.
18
18
"""
19
19
 
20
 
import sys
21
 
 
22
20
from bzrlib import tests
23
21
 
24
22
 
25
23
try:
26
 
    from bzrlib.tests.ftp_server import medusa_based
27
 
    # medusa is bogus under python2.6
28
 
    medusa_available = sys.version_info < (2, 6)
29
 
except ImportError:
30
 
    medusa_available = False
31
 
 
32
 
 
33
 
try:
34
24
    from bzrlib.tests.ftp_server import pyftpdlib_based
35
25
    pyftpdlib_available = True
36
26
except ImportError:
48
38
    """
49
39
 
50
40
    def _probe(self):
51
 
        return medusa_available or pyftpdlib_available
 
41
        return pyftpdlib_available
52
42
 
53
43
    def feature_name(self):
54
44
        return 'FTPServer'
79
69
        raise tests.UnavailableFeature(FTPServerFeature)
80
70
 
81
71
 
82
 
if medusa_available:
83
 
    FTPTestServer = medusa_based.FTPTestServer
84
 
elif pyftpdlib_available:
 
72
if pyftpdlib_available:
85
73
    FTPTestServer = pyftpdlib_based.FTPTestServer
86
74
else:
87
75
    FTPTestServer = UnavailableFTPTestServer