[MERGE] Fix exception when ScopeReplacer is assigned to before retrieving any members

John Arbash Meinel john at arbash-meinel.com
Fri Nov 9 02:21:52 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> Hi all,
> 
> This patch fixes the bug Adeodato Simò observed.  This is a corner-case
> bug, to be sure, as it only happens when the first operation on a module
> or package is assignment.
> 
> But it was exposed by Bzrtools, which emits a warning from its own
> run_argv_aliases, and this caused
> bzrlib.commands.option._verbosity_level to be set before any members of
> bzrlib.commands.option had been retrieved.
> 
> Aaron

The only thing I would say, is that we should probably test that:

+        test_obj6.bar = 'test'
+        self.assertNotEqual(lazy_import.ScopeReplacer,
+                            object.__getattribute__(test_obj6, '__class__'))

         self.assertEqual('test', test_obj6.bar)

Just to make sure that the attribute is actually set. Otherwise:

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHM8RAJdeBCYSNAAMRApIAAKCJFHHstaUkX/IUkxvf97/xXRV4PQCfRbyy
098rbBhAwfkWNt34E9zBMk0=
=eVmW
-----END PGP SIGNATURE-----



More information about the bazaar mailing list