Changeset 413

Show
Ignore:
Timestamp:
Fri Jan 25 12:47:50 2008
Author:
naufraghi
Message:

Restore compatibility with python 2.4

Files:

Legend:

Unmodified
Added
Removed
Modified
  • branches/python2.5/buildtests/test14.py

    r402 r413  
    1   # Copyright (C) 2005, Giovanni Bajo  
      1 # Copyright (C) 2007, Matteo Bertini  
    1 1 # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.  
    2 2 #  
     
    18 18 print "test14 - Used to fail if _xmlplus is installed"  
    19 19  
    20   import subprocess  
      20 import sys  
      21 if sys.version_info[:2] >= (2, 5):  
      22     import subprocess     
      23     import xml.etree.ElementTree as ET  
      24     print "#"*50  
      25     print "xml.etree.ElementTree", dir(ET)  
      26     print "#"*50  
      27     import xml.etree.cElementTree as cET  
      28  
      29     pyexe = open("python_exe.build").read()  
      30  
      31     out = subprocess.Popen(pyexe + ' -c "import xml.etree.cElementTree as cET; print dir(cET)"',  
      32                            stdout=subprocess.PIPE, shell=True).stdout.read().strip()  
      33     assert str(dir(cET)) == out, (str(dir(cET)), out)  
      34  
      35     print "test14 DONE"  
      36 else:  
      37     print "Python 2.5 test14 skipped"  
    21 38  
    22   import xml.etree.ElementTree as ET  
    23   print "#"*50  
    24   print "xml.etree.ElementTree", dir(ET)  
    25   print "#"*50  
    26   import xml.etree.cElementTree as cET  
    27    
    28   pyexe = open("python_exe.build").read()  
    29    
    30   out = subprocess.Popen(pyexe + ' -c "import xml.etree.cElementTree as cET; print dir(cET)"',  
    31                          stdout=subprocess.PIPE, shell=True).stdout.read().strip()  
    32   assert str(dir(cET)) == out, (str(dir(cET)), out)  
    33    
    34   print "test14 DONE"  
  • branches/python2.5/buildtests/test13.py

    r381 r413  
    1   # Copyright (C) 2005, Giovanni Bajo  
      1 # Copyright (C) 2007, Matteo Bertini  
    1 1 # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.  
    2 2 #  
     
    18 18 print "test13 - Used to fail if _xmlplus is installed"  
    19 19  
    20   import _elementtree  
      20 import sys  
      21 if sys.version_info[:2] >= (2, 5):  
      22     import _elementtree  
      23     print "test13 DONE"  
      24 else:  
      25     print "Python 2.5 test13 skipped"  
    21 26  
    22   print "test13 DONE"  
  • branches/python2.5/buildtests/test15.py

    r403 r413  
    1   # Copyright (C) 2005, Giovanni Bajo  
      1 # Copyright (C) 2007, Matteo Bertini  
    1 1 # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.  
    2 2 #  
     
    19 19  
    20 20 import sys  
    21   import subprocess  
    22   import email  
      21 if sys.version_info[:2] >= (2, 5):  
      22     import subprocess  
      23     import email  
    23 24  
    24   assert type(email.Header) == email.LazyImporter  
      25     assert type(email.Header) == email.LazyImporter  
    24 25  
    25   pyexe = open("python_exe.build").read()  
    26   out = subprocess.Popen(pyexe + ' -c "import sys; print sys.getfilesystemencoding()"',  
    27                          stdout=subprocess.PIPE, shell=True).stdout.read().strip()  
    28   assert str(sys.getfilesystemencoding()) == out, (str(sys.getfilesystemencoding()), out)  
      26     pyexe = open("python_exe.build").read()  
      27     out = subprocess.Popen(pyexe + ' -c "import sys; print sys.getfilesystemencoding()"',  
      28                            stdout=subprocess.PIPE, shell=True).stdout.read().strip()  
      29     assert str(sys.getfilesystemencoding()) == out, (str(sys.getfilesystemencoding()), out)  
      30  
      31     print "test15 DONE"  
      32 else:  
      33     print "Python 2.5 test14 skipped"  
    29 34  
    30   print "test15 DONE"