Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
persistent
Commits
cf1f66ff
Commit
cf1f66ff
authored
Apr 08, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More fixes for ZODB's persistentclass tests. Not tested here.
parent
81da2c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
persistent/picklecache.py
persistent/picklecache.py
+15
-3
No files found.
persistent/picklecache.py
View file @
cf1f66ff
...
@@ -17,10 +17,8 @@ import weakref
...
@@ -17,10 +17,8 @@ import weakref
from
zope.interface
import
implementer
from
zope.interface
import
implementer
from
persistent.interfaces
import
CHANGED
from
persistent.interfaces
import
GHOST
from
persistent.interfaces
import
GHOST
from
persistent.interfaces
import
IPickleCache
from
persistent.interfaces
import
IPickleCache
from
persistent.interfaces
import
STICKY
from
persistent.interfaces
import
OID_TYPE
from
persistent.interfaces
import
OID_TYPE
from
persistent.interfaces
import
UPTODATE
from
persistent.interfaces
import
UPTODATE
from
persistent
import
Persistent
from
persistent
import
Persistent
...
@@ -59,8 +57,14 @@ class PickleCache(object):
...
@@ -59,8 +57,14 @@ class PickleCache(object):
# We expect the jars to be able to have a pointer to
# We expect the jars to be able to have a pointer to
# us; this is a reference cycle, but certain
# us; this is a reference cycle, but certain
# aspects of invalidation and accessing depend on it.
# aspects of invalidation and accessing depend on it.
# The actual Connection objects we're used with do set this
# automatically, but many test objects don't.
# TODO: track this on the persistent objects themself?
# TODO: track this on the persistent objects themself?
jar
.
_cache
=
self
try
:
jar
.
_cache
=
self
except
AttributeError
:
# Some ZODB tests pass in an object that cannot have an _cache
pass
self
.
target_size
=
target_size
self
.
target_size
=
target_size
self
.
drain_resistance
=
0
self
.
drain_resistance
=
0
self
.
non_ghost_count
=
0
self
.
non_ghost_count
=
0
...
@@ -375,7 +379,15 @@ class PickleCache(object):
...
@@ -375,7 +379,15 @@ class PickleCache(object):
break
break
node
=
node
.
next
node
=
node
.
next
elif
oid
in
self
.
persistent_classes
:
elif
oid
in
self
.
persistent_classes
:
persistent_class
=
self
.
persistent_classes
[
oid
]
del
self
.
persistent_classes
[
oid
]
del
self
.
persistent_classes
[
oid
]
try
:
# ZODB.persistentclass.PersistentMetaClass objects
# have this method and it must be called for transaction abort
# and other forms of invalidation to work
persistent_class
.
_p_invalidate
()
except
AttributeError
:
pass
def
__remove_from_ring
(
self
,
node
):
def
__remove_from_ring
(
self
,
node
):
"Take the node, which previously contained a non-ghost, out of the ring"
"Take the node, which previously contained a non-ghost, out of the ring"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment