[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/schemagen - typereg.py:1.3

Tim Peters tim.one@comcast.net
Fri, 20 Dec 2002 17:31:07 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/schemagen
In directory cvs.zope.org:/tmp/cvs-serv2135/lib/python/Zope/App/schemagen

Modified Files:
	typereg.py 
Log Message:
Synch with the current version of datetime.py.  This includes a beefed-
up test suite.
Note that tzinfo objects must now derive from datetime.tzinfo.
Note that repr() strings now include the module name, such as
datetime.date or datetime.timetz.  This is for compatibility with the
Python 2.3's C implementation (which, alas, doesn't compile under
Python 2.2.2).
Note that there's a bug in Python 2.2.2 (fixed in CVS) that the test
suite worms around.


=== Zope3/lib/python/Zope/App/schemagen/typereg.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/schemagen/typereg.py:1.2	Thu Dec 12 05:45:53 2002
+++ Zope3/lib/python/Zope/App/schemagen/typereg.py	Fri Dec 20 17:30:36 2002
@@ -62,7 +62,9 @@
     __implements__ = ITypeRepresentation
 
     def __init__(self, dt):
-        self.text = repr(dt)
+        r = repr(dt)
+        assert r.startswith('datetime.')
+        self.text = r[9:]
         self.importList = [('datetime', type(dt).__name__)]
 
     def getTypes():