bzrlig.branch and the signal module

}--o viktor.nagy at gmail.com
Sun Mar 21 10:39:39 GMT 2010


Hi,

I have a project that was frozen for some time, but have to restart work on
it again. It basically integrates bazaar, and has a line that reads

from bzrlib import branch, bzrdir

nothing fancy, uh

the problem is, that branch would import bzrlib.lock, that imports
brzlib.error what finally imports bzrlib.osutils, and at line 1446 osutils
calls

signal.signal(signal.SIGWINCH, _terminal_size_changed)

and a traceback is thrown:

  File "/home/nagyv/workspace/CooSci/webapp/bzr/util.py", line 2, in
<module>
    from bzrlib import branch, bzrdir
  File
"/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/branch.py",
line 52, in <module>
    from bzrlib.lock import _RelockDebugMixin
  File
"/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/lock.py",
line 42, in <module>
    from bzrlib import (
  File
"/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/errors.py",
line 20, in <module>
    from bzrlib import (
  File
"/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/osutils.py",
line 1446, in <module>
    signal.signal(signal.SIGWINCH, _terminal_size_changed)
ValueError: signal only works in main thread

The import above worked with some old version of bazaar, but it would be
nice to update the code for bazaar 2.1 at least. So, could someone help me
in changing the code above so that is will run fine?

thanks a lot,
Viktor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20100321/c14ee18d/attachment.htm 


More information about the bazaar mailing list