forked from pool/python-testtools
- Remove requirements of unittest2 and linecache2 adding two additional patches remove-linecache2.patch and remove-unittest2.patch. OBS-URL: https://build.opensuse.org/request/show/645918 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=61
26 lines
754 B
Diff
26 lines
754 B
Diff
--- a/testtools/tests/test_compat.py
|
|
+++ b/testtools/tests/test_compat.py
|
|
@@ -3,7 +3,10 @@
|
|
"""Tests for miscellaneous compatibility functions"""
|
|
|
|
import io
|
|
-import linecache2 as linecache
|
|
+try:
|
|
+ import linecache2 as linecache
|
|
+except ImportError:
|
|
+ import linecache
|
|
import os
|
|
import sys
|
|
import tempfile
|
|
--- a/testtools/compat.py
|
|
+++ b/testtools/compat.py
|
|
@@ -31,7 +31,7 @@ from extras import try_import, try_impor
|
|
BytesIO = try_imports(['StringIO.StringIO', 'io.BytesIO'])
|
|
StringIO = try_imports(['StringIO.StringIO', 'io.StringIO'])
|
|
# To let setup.py work, make this a conditional import.
|
|
-linecache = try_import('linecache2')
|
|
+linecache = try_imports(['linecache2', 'linecache'])
|
|
|
|
try:
|
|
from testtools import _compat2x as _compat
|