mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
remove cross-version compatibility code
This commit is contained in:
parent
bd56722a27
commit
0e717addd8
2 changed files with 9 additions and 50 deletions
|
@ -22,30 +22,10 @@ import unittest
|
|||
import warnings
|
||||
import argparse
|
||||
|
||||
from StringIO import StringIO
|
||||
|
||||
from test import test_support
|
||||
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
try:
|
||||
set
|
||||
except NameError:
|
||||
from sets import Set as set
|
||||
|
||||
try:
|
||||
sorted
|
||||
except NameError:
|
||||
|
||||
def sorted(iterable, reverse=False):
|
||||
result = list(iterable)
|
||||
result.sort()
|
||||
if reverse:
|
||||
result.reverse()
|
||||
return result
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
|
||||
def assertEqual(self, obj1, obj2):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue