From 58a658b26d1c95b31d02050dcccd648d2e4ce27b Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Mon, 20 Jun 2011 22:55:16 +0100 Subject: Changes to support 2.x and 3.x in the same codebase. --HG-- branch : distribute extra : rebase_source : 7d3608edee54a43789f0574d702fb839628b5071 --- setuptools/tests/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'setuptools/tests/__init__.py') diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py index 9af44a88..669bb826 100644 --- a/setuptools/tests/__init__.py +++ b/setuptools/tests/__init__.py @@ -7,6 +7,7 @@ import setuptools, setuptools.dist from setuptools import Feature from distutils.core import Extension extract_constant, get_module_constant = None, None +from setuptools.compat import func_code from setuptools.depends import * from distutils.version import StrictVersion, LooseVersion from distutils.util import convert_path @@ -50,17 +51,18 @@ class DependsTests(TestCase): x = "test" y = z + fc = func_code(f1) # unrecognized name - self.assertEqual(extract_constant(f1.func_code,'q', -1), None) + self.assertEqual(extract_constant(fc,'q', -1), None) # constant assigned - self.assertEqual(extract_constant(f1.func_code,'x', -1), "test") + self.assertEqual(extract_constant(fc,'x', -1), "test") # expression assigned - self.assertEqual(extract_constant(f1.func_code,'y', -1), -1) + self.assertEqual(extract_constant(fc,'y', -1), -1) # recognized name, not assigned - self.assertEqual(extract_constant(f1.func_code,'z', -1), None) + self.assertEqual(extract_constant(fc,'z', -1), None) def testFindModule(self): -- cgit v1.2.3