mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 05:11:25 +08:00
Fixed caching issues
Fixed exception raised during cache reading Switched cache hashing to hashlib In python 3.3 the hash function is returning different hashes during different executions of the application.
This commit is contained in:
@@ -21,6 +21,7 @@ from __future__ import with_statement
|
||||
import time
|
||||
import os
|
||||
import sys
|
||||
import hashlib
|
||||
try:
|
||||
import cPickle as pickle
|
||||
except:
|
||||
@@ -312,7 +313,7 @@ class _ModulePickling(object):
|
||||
shutil.rmtree(self._cache_directory())
|
||||
|
||||
def _get_hashed_path(self, path):
|
||||
return self._get_path('%s.pkl' % hash(path))
|
||||
return self._get_path('%s.pkl' % hashlib.md5(path.encode("utf-8")).hexdigest())
|
||||
|
||||
def _get_path(self, file):
|
||||
dir = self._cache_directory()
|
||||
|
||||
@@ -560,7 +560,7 @@ class Flow(Scope):
|
||||
@parent.setter
|
||||
def parent(self, value):
|
||||
self._parent = value
|
||||
if self.next:
|
||||
if hasattr(self, "next") and self.next:
|
||||
self.next.parent = value
|
||||
|
||||
def get_code(self, first_indent=False, indention=' '):
|
||||
|
||||
Reference in New Issue
Block a user