]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
try/except around init.__name__ = oldinit.__name__ for py2.3 compat
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Jun 2006 14:57:10 +0000 (14:57 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Jun 2006 14:57:10 +0000 (14:57 +0000)
CHANGES
lib/sqlalchemy/orm/mapper.py

diff --git a/CHANGES b/CHANGES
index 5bcbda4d737cb209e9cf13b7e0886601efeea586..93727226a14bcb84a098338369025ede32a5680b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.2.4
+- try/except when the mapper sets init.__name__ on a mapped class,
+supports python 2.3
+
 0.2.3
 - overhaul to mapper compilation to be deferred.  this allows mappers
 to be constructed in any order, and their relationships to each
index ac8d6f330fa32e9632ae531bb0d0886468d07847..2d118e9e56b4d4b65de1bfbaff37aebf6c58a21f 100644 (file)
@@ -477,8 +477,12 @@ class Mapper(object):
         # override oldinit, insuring that its not already a Mapper-decorated init method
         if oldinit is None or not hasattr(oldinit, '_sa_mapper_init'):
             init._sa_mapper_init = True
-            init.__name__ = oldinit.__name__
-            init.__doc__ = oldinit.__doc__
+            try:
+                init.__name__ = oldinit.__name__
+                init.__doc__ = oldinit.__doc__
+            except:
+                # cant set __name__ in py 2.3 !
+                pass
             self.class_.__init__ = init
         mapper_registry[self.class_key] = self
         if self.entity_name is None: