[PATCH][BUG] bzr selftest runs the global bzr

John A Meinel john at arbash-meinel.com
Tue Jun 28 04:10:01 BST 2005


Martin Pool wrote:

>On 26 Jun 2005, John A Meinel <john at arbash-meinel.com> wrote:
>
>
>
>>I forgot to mention, by lazy-import tree is available at:
>>http://bzr.arbash-meinel.com/bzr-mainline/bzr-faster-start/
>>
>>
>
>OK, merged in.  That's good work.
>
>Are the special factories for ElementTree types in bzrlib.xml really
>needed?  Couldn't we just import ElementTree in the scope where they're
>first used?
>
>
Just to be clear, I would leave the try/catch import in xml.py, and
leave ElementTree, Element, and SubElement as available module members.

xml.py:
try:
    from cElementTree import ElementTree, Element, SubElement
except ImportError:
    from elementtree.ElementTree import ElementTree, Element, SubElement

class XMLMixin(object):
...

Then anyone who needs it can import xml.py to get them. If you want to
have xml.py loaded late, that is fine, it is just cleaner than putting
one of these try/except blocks all over the place.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050627/0ee70040/attachment.pgp 


More information about the bazaar mailing list