File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
cherry_picker/cherry_picker Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33
44import click
55import collections
6+ import enum
67import os
78import subprocess
89import webbrowser
@@ -40,9 +41,9 @@ class InvalidRepoException(Exception):
4041
4142class CherryPicker :
4243
43- ALLOWED_STATES = (
44- 'BACKPORT_PAUSED ' ,
45- 'UNSET' ,
44+ ALLOWED_STATES = enum . Enum (
45+ 'Allowed states ' ,
46+ 'BACKPORT_PAUSED UNSET' ,
4647 )
4748 """The list of states expected at the start of the app."""
4849
@@ -435,12 +436,13 @@ def get_state_and_verify(self):
435436 cherry_picker would have stored in the config.
436437 """
437438 state = get_state ()
438- if state not in self .ALLOWED_STATES :
439+ if state not in self .ALLOWED_STATES . __members__ :
439440 raise ValueError (
440441 f'Run state cherry-picker.state={ state } in Git config '
441442 'is not known.\n Perhaps it has been set by a newer '
442443 'version of cherry-picker. Try upgrading.\n '
443- f'Valid states are: { ", " .join (self .ALLOWED_STATES )} . '
444+ 'Valid states are: '
445+ f'{ ", " .join (self .ALLOWED_STATES .__members__ .keys ())} . '
444446 'If this looks suspicious, raise an issue at '
445447 'https://github.com/python/core-workflow/issues/new.\n '
446448 'As the last resort you can reset the runtime state '
You can’t perform that action at this time.
0 commit comments