fix uid generation for py >= 2.5 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 22 Sep 2009 10:04:58 +0200
branchstable
changeset 3364 039d1694f36d
parent 3363 d3736311d0c4
child 3365 b8f94bcf0034
fix uid generation for py >= 2.5
utils.py
--- a/utils.py	Tue Sep 22 10:04:45 2009 +0200
+++ b/utils.py	Tue Sep 22 10:04:58 2009 +0200
@@ -118,7 +118,10 @@
 else:
     from uuid import uuid4
     def make_uid(key):
-        return str(key) + str(uuid4())
+        # remove dash, generated uid are used as identifier sometimes (sql table
+        # names at least)
+        return str(key) + str(uuid4()).replace('-', '')
+
 
 def dump_class(cls, clsname):
     """create copy of a class by creating an empty class inheriting