This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Patch for Lib/bsddb/__init__.py to work with modulefinder
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: barry Nosy List: anadelonbrin, barry, loewis
Priority: normal Keywords: patch

Created on 2005-01-30 23:22 by anadelonbrin, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
__init__.py.option1 anadelonbrin, 2005-01-30 23:22 Patch for first option (move imports out of exec)
__init__.py.option2 anadelonbrin, 2005-01-30 23:23 Patch for second option (remove exec)
Messages (3)
msg47633 - (view) Author: Tony Meyer (anadelonbrin) Date: 2005-01-30 23:22
The Python 2.4 Lib/bsddb/__init__.py contains this:

"""
# for backwards compatibility with python versions
older than 2.3, the
# iterator interface is dynamically defined and added
using a mixin
# class.  old python can't tokenize it due to the yield
keyword.
if sys.version >= '2.3':
    exec """
import UserDict
from weakref import ref
class _iter_mixin(UserDict.DictMixin):
...
"""

Because the imports are inside an exec, modulefinder
(e.g. when using bsddb with a py2exe built application)
does not realise that the imports are required.  (The
requirement can be manually specified, of course, if
you know that you need to do so).

There are two options for easy fixes for this:

  1. Move the imports outside the exec.  This wouldn't
effect the code at all, but would let modulefinder know
that they were there.

  2.  If 2.1 compatibility isn't required for the bsddb
module in Python 2.5, then the if and exec portion
could be completely removed.

Patches against today's anon CVS for each of these
options are attached.
msg47634 - (view) Author: Tony Meyer (anadelonbrin) Date: 2005-01-30 23:25
Logged In: YES 
user_id=552329

Martin v. Löwis (on python-dev) indicated that Barry or Greg
Ward would be the appropriate person to decide which was the
correct option, so changing assignment to Barry.  Apologies
if is this not correct!
msg47635 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-03-03 09:47
Logged In: YES 
user_id=21627

Thanks for the patch. As Barry has not bumped the backwards
compatibility requirements for bsddb yet, I went with your
option 1, and committed it as

__init__.py 1.15.4.1
NEWS 1.1193.2.25
__init__.py 1.16
NEWS 1.1253
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41504
2005-01-30 23:22:44anadelonbrincreate