diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/decimal.py | 4 | ||||
-rw-r--r-- | Lib/distutils/command/bdist_msi.py | 5 | ||||
-rw-r--r-- | Lib/distutils/tests/test_bdist_msi.py | 23 | ||||
-rw-r--r-- | Lib/test/test_sysconfig.py | 9 |
4 files changed, 30 insertions, 11 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index a72afdc..d0c4df2 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -3600,12 +3600,12 @@ class Decimal(object): return (self.__class__, (str(self),)) def __copy__(self): - if type(self) == Decimal: + if type(self) is Decimal: return self # I'm immutable; therefore I am my own clone return self.__class__(str(self)) def __deepcopy__(self, memo): - if type(self) == Decimal: + if type(self) is Decimal: return self # My components are also immutable return self.__class__(str(self)) diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index 404f215..f13c73b 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -7,15 +7,12 @@ Implements the bdist_msi command. """ import sys, os -from sysconfig import get_python_version +from sysconfig import get_python_version, get_platform -import sys, os from distutils.core import Command from distutils.dir_util import remove_tree -from distutils.sysconfig import get_python_version from distutils.version import StrictVersion from distutils.errors import DistutilsOptionError -from distutils.util import get_platform from distutils import log import msilib diff --git a/Lib/distutils/tests/test_bdist_msi.py b/Lib/distutils/tests/test_bdist_msi.py new file mode 100644 index 0000000..ba2d3e1 --- /dev/null +++ b/Lib/distutils/tests/test_bdist_msi.py @@ -0,0 +1,23 @@ +"""Tests for distutils.command.bdist_msi.""" +import unittest +import sys + +from distutils.tests import support + +@unittest.skipUnless(sys.platform=="win32", "These tests are only for win32") +class BDistMSITestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def test_minial(self): + # minimal test XXX need more tests + from distutils.command.bdist_msi import bdist_msi + pkg_pth, dist = self.create_dist() + cmd = bdist_msi(dist) + cmd.ensure_finalized() + +def test_suite(): + return unittest.makeSuite(BDistMSITestCase) + +if __name__ == '__main__': + test_support.run_unittest(test_suite()) diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 0f8f89a..5b50901 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -145,14 +145,14 @@ class TestSysConfig(unittest.TestCase): get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g ' '-fwrapv -O3 -Wall -Wstrict-prototypes') - maxsize = sys.maxsize + maxint = sys.maxsize try: sys.maxsize = 2147483647 self.assertEquals(get_platform(), 'macosx-10.3-ppc') sys.maxsize = 9223372036854775807 self.assertEquals(get_platform(), 'macosx-10.3-ppc64') finally: - sys.maxsize = maxsize + sys.maxsize = maxint self._set_uname(('Darwin', 'macziade', '8.11.1', @@ -164,15 +164,14 @@ class TestSysConfig(unittest.TestCase): get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g ' '-fwrapv -O3 -Wall -Wstrict-prototypes') - - maxsize = sys.maxsize + maxint = sys.maxsize try: sys.maxsize = 2147483647 self.assertEquals(get_platform(), 'macosx-10.3-i386') sys.maxsize = 9223372036854775807 self.assertEquals(get_platform(), 'macosx-10.3-x86_64') finally: - sys.maxsize = maxsize + sys.maxsize = maxint # macbook with fat binaries (fat, universal or fat64) os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4' |