--- analyze.py	2009-05-02 21:57:30.000000000 +0200
+++ analyze.py	2009-05-20 14:01:11.000000000 +0200
@@ -7,6 +7,7 @@
 import sys
 import types
 from ZODB.FileStorage import FileStorage
+from ZODB.utils import get_pickle_metadata
 
 class Report:
     def __init__(self):
@@ -86,21 +87,8 @@
         analyze_rec(report, rec)
 
 def get_type(record):
-    try:
-        classinfo = pickle.loads(record.data)[0]
-    except SystemError, err:
-        s = str(err)
-        mo = re.match('Failed to import class (\S+) from module (\S+)', s)
-        if mo is None:
-            raise
-        else:
-            klass, mod = mo.group(1, 2)
-            return "%s.%s" % (mod, klass)
-    if isinstance(classinfo, types.TupleType):
-        mod, klass = classinfo
-        return "%s.%s" % (mod, klass)
-    else:
-        return str(classinfo)
+    mod, klass = get_pickle_metadata(record.data)
+    return "%s.%s" % (mod, klass)
 
 def analyze_rec(report, record):
     oid = record.oid
