apply patch by Toshio Kuratomi to fix some unit tests with Python 2.6

This commit is contained in:
jan.dittberner
2009-01-27 12:57:38 +00:00
parent 0fa7d4103e
commit 8f81d735ae

View File

@@ -1,6 +1,7 @@
import sys import sys
import traceback import traceback
from StringIO import StringIO from StringIO import StringIO
from types import FileType
import os,shutil import os,shutil
from test import fixture from test import fixture
from migrate.versioning.repository import Repository from migrate.versioning.repository import Repository
@@ -19,7 +20,7 @@ class Shell(fixture.Shell):
def execute(self,shell_cmd,runshell=None): def execute(self,shell_cmd,runshell=None):
"""A crude simulation of a shell command, to speed things up""" """A crude simulation of a shell command, to speed things up"""
# If we get an fd, the command is already done # If we get an fd, the command is already done
if isinstance(shell_cmd,file) or isinstance(shell_cmd,StringIO): if isinstance(shell_cmd, FileType) or isinstance(shell_cmd, StringIO):
return shell_cmd return shell_cmd
# Analyze the command; see if we can 'fake' the shell # Analyze the command; see if we can 'fake' the shell
try: try: