[Zope3-checkins] CVS: Zope3/src/zope/app/rdb/tests -
test_gadflyadapter.py:1.3
Jeremy Hylton
cvs-admin at zope.org
Tue Nov 4 22:08:52 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/rdb/tests
In directory cvs.zope.org:/tmp/cvs-serv25892/app/rdb/tests
Modified Files:
test_gadflyadapter.py
Log Message:
Remove code that isn't needed now that we require Python 2.3.
Cases include future statements for generators, special case
definitions of builtins like basestring and enumerate, a few uses of
types that are unnecessary.
=== Zope3/src/zope/app/rdb/tests/test_gadflyadapter.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/rdb/tests/test_gadflyadapter.py:1.2 Wed Dec 25 09:13:14 2002
+++ Zope3/src/zope/app/rdb/tests/test_gadflyadapter.py Tue Nov 4 22:08:18 2003
@@ -19,28 +19,8 @@
import os
import tempfile
from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.rdb import DatabaseAdapterError
-
-try:
- from tempfile import mkdtemp
-except ImportError:
- import errno
-
- def mkdtemp(suffix=""):
- """Poor man's version of tempfile.mkdtemp from Python 2.3"""
-
- for seq in xrange(1000):
- name = tempfile.mktemp(suffix)
- try:
- os.mkdir(name, 0700)
- return name
- except IOError, e:
- if e.errno == errno.EEXIST:
- continue
- raise
-
- raise IOError(errno.EEXIST, "No usable temporary directory name found")
+from zope.app.rdb import DatabaseAdapterError
class GadflyTestBase(TestCase):
@@ -56,7 +36,7 @@
def getGadflyRoot(self):
# note that self is GadflyTestBase here
if not self.tempdir:
- self.tempdir = mkdtemp('gadfly')
+ self.tempdir = tempfile.mkdtemp('gadfly')
return self.tempdir
def _create(self, *args):
More information about the Zope3-Checkins
mailing list