Permalink
Browse files

search-notes.py: Use cPickle when available

  • Loading branch information...
xolox committed Apr 21, 2013
1 parent af27b21 commit 548f8bb5681b284069e780a12302ba54d4d38701
Showing with 7 additions and 1 deletion.
  1. +7 −1 misc/notes/search-notes.py
@@ -44,10 +44,16 @@
import fnmatch
import getopt
import os
-import pickle
import re
import sys
+# Load the faster C variant of the pickle module where possible, but
+# fall back to the Python implementation that's always available.
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+
try:
import Levenshtein
levenshtein_supported = True

0 comments on commit 548f8bb

Please sign in to comment.