Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing dict.has_key in Python3 #18

Merged
merged 1 commit into from
Sep 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ New features:

Bug fixes:

- Fix missing ``dict.has_key`` in Python3
[ale-rt]

- Fix GopipIndex for py3
[pbauer]

Expand Down
10 changes: 7 additions & 3 deletions src/plone/app/folder/migration.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_base
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base as BTreeFolder
from Products.Five.browser import BrowserView
from logging import getLogger
from plone.app.folder.utils import checkpointIterator
from plone.app.folder.utils import findObjects
from plone.app.folder.utils import timer
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base as BTreeFolder
from Products.Five.browser import BrowserView
from time import clock
from time import strftime
from transaction import get


logger = getLogger(__name__)


Expand All @@ -36,7 +37,10 @@ def migrate(self, folder):
folder = aq_base(folder)
assert isinstance(folder, BTreeFolder)
assert folder.getId() # make sure the object is properly loaded
has = folder.__dict__.has_key

def has(key):
return key in folder.__dict__

if has('_tree') and not has('_objects'):
return False # already migrated...
folder._initBTrees() # create _tree, _count, _mt_index
Expand Down