[prev in list] [next in list] [prev in thread] [next in thread] 

List:       getmail
Subject:    Re: Python 2.6 sets Deprecation Warning
From:       "Charles Cazabon" <search-web-for-address () pyropus ! ca>
Date:       2009-03-07 3:47:56
Message-ID: 20090307034756.GA14394 () pyropus ! ca
[Download RAW message or body]

Nathaniel P Dawson <nathaniel.dawson@gmail.com> wrote:
> Hello, I've noticed an annoying warning when using Python 2.6 about
> sets being deprecated.

Thanks; I'm sure someone will find it a useful addition.

There's also another warning triggered by code in the Python library (in the
email module) when getmail is run with certain versions of Python.  If anyone
wants a way to silence the warnings without modifying the code, you can do it
by invoking Python with the appropriate -W option at startup:

  python -W[...] /path/to/getmail [...]

> +if sys.version.split()[0] < '2.4':

FYI, it's probably cleaner to test against sys.hexversion; no string parsing
necessary:

  if sys.hexversion < 0x02040000:

If I were to use this, I'd probably move it into a module of its own so the
conditional is only present in one place, and import that module wherever sets
are used.  It's cleaner than having the conditional definition in every
module.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: getmail-unsubscribe@lists.pyropus.ca
For additional commands, e-mail: getmail-help@lists.pyropus.ca

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic