Redundant `from six.moves import _thread` failed on mac os x

Bug #1493500 reported by Guy Rapaport
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dateutil
New
Undecided
Unassigned

Bug Description

I got an error saying "can't import thread_ from six.moves" and pointing me to this file:
/Library/Python/2.7/site-packages/dateutil/rrule.py

I nano'd it and what do I see?

    from six.moves import _thread

and some lines below, the only use of _thread was

            self._cache_lock = _thread.allocate_lock()

My version of six (1.9.0) did not have _thread defined inside its moves module (i.e. dir(six.moves) does not incldue _thread).
However, it seems you have been aiming at Python's ordinary thread module. I commented out your import and replaced it with:

    import thread as _thread

and everything started working back again.

So if there's no reason to import thread from within six.moves, I think you should ditch that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.