[MERGE][bug #297831] don't call chdir('')

John Arbash Meinel john at arbash-meinel.com
Wed Nov 19 17:38:42 GMT 2008


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

Aaron Bentley wrote:
> Aaron Bentley has voted tweak.
> Status is now: Conditionally approved
> Comment:
> Please change the test to if path != "" and -1 == chdir(path)
> 
> For details, see:
> http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C49244692.4050507%40arbash-meinel.com%3E
> 
> Project: Bazaar
> 
> 

So I actually disagree with this, as "if path" can be translated into a
very cheap "PyObject_True(path)" call, rather than having to create a
temporary string object for "", and then call PyObject_Compare(path,
tmp_obj).

I know you've felt that we've been too lose about using the boolean
attribute of objects, which lets [], None, and '' all evaluate to False,
but I feel it is fine here.

If we have gotten this far and don't have a String, we are going to fail
horribly anyway.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkkTyIACgkQJdeBCYSNAAOiOQCgu6ZN7h7EtBKdJp8jLtHzK1TI
gCgAoIpmb+oMn9rGq9ITgmCYyy7w1s1Q
=pwmw
-----END PGP SIGNATURE-----



More information about the bazaar mailing list