Skip to content

Commit ac01eab

Browse files
committed
avoid hard-coding argument chocies
1 parent 2512db4 commit ac01eab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/compileall.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ def main():
253253
'to the equivalent of -l sys.path'))
254254
parser.add_argument('-j', '--workers', default=1,
255255
type=int, help='Run compileall concurrently')
256+
invalidation_modes = [mode.name.lower().replace('_', '-')
257+
for mode in py_compile.PycInvalidationMode]
256258
parser.add_argument('--invalidation-mode', default='timestamp',
257-
choices=('timestamp', 'checked-hash', 'unchecked-hash'),
259+
choices=sorted(invalidation_modes),
258260
help='How the pycs will be invalidated at runtime')
259261

260262
args = parser.parse_args()

0 commit comments

Comments
 (0)