Re: import queue in Python 2 and Python 3

2017-06-30 Thread Thomas Jollans
On 30/06/17 06:06, Benjamin Chaney wrote: > What is the best way to import the synchronized queue class that is > compatible with both Python2 and Python3. Right now I am using the > following: > >> if sys.version_info < (3, 0): >>import Queue as queue >> else: >>import queue > > This see

Re: import queue in Python 2 and Python 3

2017-06-29 Thread Chris Angelico
On Fri, Jun 30, 2017 at 2:06 PM, Benjamin Chaney wrote: > What is the best way to import the synchronized queue class that is > compatible with both Python2 and Python3. Right now I am using the > following: > >>if sys.version_info < (3, 0): >>import Queue as queue >>else: >>import queue >

import queue in Python 2 and Python 3

2017-06-29 Thread Benjamin Chaney
What is the best way to import the synchronized queue class that is compatible with both Python2 and Python3. Right now I am using the following: >if sys.version_info < (3, 0): >import Queue as queue >else: >import queue This seems somewhat unpythonic. Is there a better way without instal