Commits

Armin Rigo  committed bae124a Merge

hg merge default

  • Participants
  • Parent commits 31f46a2, dbd12e1
  • Branches verifier2

Comments (0)

Files changed (2)

File cffi/verifier.py

-import sys, os, hashlib, imp, shutil
+import sys, os, binascii, imp, shutil
 from . import model, ffiplatform
 from . import __version__
 
         self.preamble = preamble
         self.kwds = kwds
         #
-        m = hashlib.md5('\x00'.join([sys.version[:3], __version__, 'pypy',
-                                     preamble] + ffi._cdefsources))
-        modulename = '_cffi_%s' % m.hexdigest()
+        key = '\x00'.join(['2', sys.version[:3], __version__, preamble] +
+                          ffi._cdefsources)
+        k1 = hex(binascii.crc32(key[0::2]) & 0xffffffff).lstrip('0').rstrip('L')
+        k2 = hex(binascii.crc32(key[1::2]) & 0xffffffff).lstrip('0').rstrip('L')
+        modulename = '_cffi_%s%s' % (k1, k2)
         suffix = _get_so_suffix()
         self.sourcefilename = os.path.join(_TMPDIR, modulename + '.c')
         self.modulefilename = os.path.join(_TMPDIR, modulename + suffix)

File demo/_curses.py

 int endwin(void);
 bool isendwin(void);
 
-char *keyname(int c);
+const char *keyname(int c);
 static const int KEY_MIN, KEY_MAX;
 
 int setupterm(char *term, int fildes, int *errret);