def _update_current(self):
if not self.current or self.current not in self.prefixes:<EOL><INDENT>if '<STR_LIT:default>' in self.prefixes:<EOL><INDENT>selected_current = '<STR_LIT:default>'<EOL><DEDENT>elif self.prefixes:<EOL><INDENT>selected_current = sorted(self.prefixes.keys()).pop()<EOL><DEDENT>else:<EOL><INDENT>raise MalformedWorkdir(<EOL>'<STR_LIT>' % self.path<EOL>)<EOL><DEDENT>logging.info(<EOL>'<STR_LIT>',<EOL>selected_current,<EOL>)<EOL>self._set_current(selected_current)<EOL><DEDENT>
Makes sure that a current is set