Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6080653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:05:11+00:00 2026-05-23T11:05:11+00:00

For some reason I can’t access the Queue.Empty exception – what am I doing

  • 0

For some reason I can’t access the Queue.Empty exception – what am I doing wrong here?

from multiprocessing import Process, Queue

# ...

try:
    action = action_queue.get(False)
    print "Action: " + action
except Queue.Empty:
    pass

The stack trace:

Traceback (most recent call last):  
File "C:\Program Files\Python27\lib\multiprocessing\process.py", line 258,
  in _bootstrap
  self.run()
File "C:\Program Files\Python27\lib\multiprocessing\process.py", line 114,
  in run
  self._target(*self._args, **self._kwargs)
File "D:\Development\populate.py", line 39, in permutate
  except Queue.Empty: AttributeError: 'function' object has no attribute 'Empty'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:05:12+00:00Added an answer on May 23, 2026 at 11:05 am

    The Queue.Empty exception is in the Queue module, not in the multiprocessing.queues.Queue class. The multiprocessing module actually uses the Queue (module) Empty exception class:

    from multiprocessing import Queue
    from Queue import Empty
    q = Queue()
    try:
        q.get( False )
    except Empty:
        print "Queue was empty"
    

    If you want to be very explicit and verbose, you can do this:

    import multiprocessing
    import Queue
    q = multiprocessing.Queue()
    try:
        q.get( False )
    except Queue.Empty:
        print "Queue was empty"
    

    Favoring the former approach is probably a better idea because there is only one Queue object to worry about and you don’t have to wonder if you are working with the class or the module as in my second example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason beyond me I can't access the mysql server on a machine.
Hi got a weird problem parsing JSON for some reason can't access the values
For some reason I can't get open() to open a file. Here's my code.
For some reason I can not remove an event handler from the FileSystemWatcher. This
Very odd situation here. For some reason I can't call 'Where', or any other
For some reason I can't find a way to get the equivalents of sqlite's
For some reason I can't use runat=server as an attribute for the input tag
For some reason I can't hide WPF Toolkit's DataGridColumn. I am trying to do
I know PHP 5 already supports SQLite but for some reason I can't get
I'm fairly new to JQuery and for some reason I can't get the currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.