From ef5c9905896203e07babaa367bc4d2ecf7fa579b Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 5 Sep 2009 10:55:47 +0000 Subject: [PATCH] Merged from trunk -r14182:14186 | 14184 | Fix documentation of some QA_* variables. | | arfrever | | | 14185 | Bug #282808 - Handle a potential KeyError inside | | zmedico | PollScheduler._poll_loop() when _poll_event_queue contains | | | an event for a file descriptor that has already been | | | unregistered. | | 14186 | Remove unnecessary redundant dict lookup at the beginning | | zmedico | of catpkgsplit(). Thanks to Marat Radchenko | | | for this patch. | svn path=/main/branches/prefix/; revision=14194 --- man/ebuild.5 | 6 +++--- pym/_emerge/PollScheduler.py | 9 ++++++++- pym/portage/versions.py | 2 -- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/man/ebuild.5 b/man/ebuild.5 index 7f4d4fa7f..dcb9b7eb0 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -480,7 +480,7 @@ Note that objects that violate these rules may fail on some architectures. \fBQA_TEXTRELS\fR This variable can be set to a list of file paths, relative to the image directory, of files that contain text relocations that cannot be eliminated. -The paths may contain regular expressions. +The paths may contain fnmatch patterns. .br This variable is intended to be used on closed\-source binary objects that cannot be altered. @@ -488,7 +488,7 @@ cannot be altered. \fBQA_EXECSTACK\fR This should contain a list of file paths, relative to the image directory, of objects that require executable stack in order to run. -The paths may contain regular expressions. +The paths may contain fnmatch patterns. .br This variable is intended to be used on objects that truly need executable stack (i.e. not those marked to need it which in fact do not). @@ -496,7 +496,7 @@ stack (i.e. not those marked to need it which in fact do not). \fBQA_WX_LOAD\fR This should contain a list of file paths, relative to the image directory, of files that contain writable and executable segments. These are rare. -The paths may contain regular expressions. +The paths may contain fnmatch patterns. .TP \fBQA_DT_HASH\fR This should contain a list of file paths, relative to the image directory, of diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py index 3733af45b..8250cb00a 100644 --- a/pym/_emerge/PollScheduler.py +++ b/pym/_emerge/PollScheduler.py @@ -123,7 +123,14 @@ class PollScheduler(object): try: while event_handlers: f, event = self._next_poll_event() - handler, reg_id = event_handlers[f] + try: + handler, reg_id = event_handlers[f] + except KeyError: + # This means unregister was called for a file descriptor + # that still had a pending event in _poll_event_queue. + # Since unregister has been called, we should assume that + # the event can be safely ignored. + continue handler(f, event) event_handled = True except StopIteration: diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 3fa96d2a4..00898a781 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -292,8 +292,6 @@ def catpkgsplit(mydata,silent=1): """ try: - if not catcache[mydata]: - return None return catcache[mydata] except KeyError: pass -- 2.26.2