[RFC] using `if WINDOWS` instead of `if sys.platform == 'win32'`?

Alexander Belchenko bialix at ukr.net
Thu Sep 6 11:16:51 BST 2007


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

There are around 100 places where bzrlib code try to check
if it run on Windows by comparing `sys.platform == 'win32'`
or similar. About the half of this checks is inside core code,
and another half in tests.

I'd like to change this places by defining in bzrlib/__init__.py
constant with name 'WINDOWS' or something similar and use
this constant where needed.

WINDOWS = sys.platform == 'win32'

...


if WINDOWS:
	do_something_crazy()

if not WINDOWS:
	do_another_thing()


Proposed change should make code more clear.
Anyone have objections or suggestions?

[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG39OTzYr338mxwCURAl7sAKCPzCwrai3Pde6T38nG2AvQ9saI8QCeLVDh
DXaM7GqNJHRHx5IO1WeNv6w=
=NZib
-----END PGP SIGNATURE-----



More information about the bazaar mailing list