[Patches] [ python-Patches-1112812 ] Patch for Lib/bsddb/__init__.py to work with modulefinder

SourceForge.net noreply at sourceforge.net
Mon Jan 31 00:25:19 CET 2005


Patches item #1112812, was opened at 2005-01-31 12:22
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1112812&group_id=5470

Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Tony Meyer (anadelonbrin)
>Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Patch for Lib/bsddb/__init__.py to work with modulefinder

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Tony Meyer (anadelonbrin)
Date: 2005-01-31 12:25

Message:
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!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1112812&group_id=5470


More information about the Patches mailing list