Author: Armin Rigo <ar...@tunes.org> Branch: stm Changeset: r48529:d382548b28e1 Date: 2011-10-27 17:10 +0200 http://bitbucket.org/pypy/pypy/changeset/d382548b28e1/
Log: Simplify. diff --git a/pypy/translator/stm/llstminterp.py b/pypy/translator/stm/llstminterp.py --- a/pypy/translator/stm/llstminterp.py +++ b/pypy/translator/stm/llstminterp.py @@ -46,17 +46,12 @@ raise ReturnWithTransactionActive(self.graph) def getoperationhandler(self, opname): - try: - return getattr(self, 'opstm_' + opname) - except AttributeError: - stm_mode = self.llinterpreter.stm_mode - attrname = '_opstm_%s__%s' % (stm_mode, opname) - ophandler = getattr(self, attrname, None) - if ophandler is None: - self._validate_stmoperation_handler(stm_mode, opname) - ophandler = LLFrame.getoperationhandler(self, opname) - setattr(self, attrname, ophandler) - return ophandler + ophandler = getattr(self, 'opstm_' + opname, None) + if ophandler is None: + self._validate_stmoperation_handler(opname) + ophandler = LLFrame.getoperationhandler(self, opname) + setattr(self, 'opstm_' + opname, ophandler) + return ophandler def _op_in_set(self, opname, set): if opname in set: @@ -66,10 +61,10 @@ return True return False - def _validate_stmoperation_handler(self, stm_mode, opname): + def _validate_stmoperation_handler(self, opname): if self._op_in_set(opname, self.ALWAYS_ALLOW_OPERATIONS): return - raise ForbiddenInstructionInSTMMode(stm_mode, opname, self.graph) + raise ForbiddenInstructionInSTMMode(opname, self.graph) # ---------- operations that are sometimes safe ---------- _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit