File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -559,9 +559,14 @@ def _help_and_exit():
559
559
default = () if option .multiple else option .default
560
560
561
561
if global_value != default and local_value != default and global_value != local_value :
562
- raise FatalError (
563
- 'Option "%s" provided for "%s" is already defined to a different value. '
564
- 'This option can appear at most once in the command line.' % (key , task .name ))
562
+ if hasattr (option , 'envvar' ) and option .envvar and os .getenv (option .envvar ) != default :
563
+ msg = (f'This option cannot be set in command line if the { option .envvar } '
564
+ 'environment variable is set to a different value.' )
565
+ else :
566
+ msg = 'This option can appear at most once in the command line.'
567
+
568
+ raise FatalError (f'Option "{ key } " provided for "{ task .name } " is already defined to '
569
+ f'a different value. { msg } ' )
565
570
if local_value != default :
566
571
global_args [key ] = local_value
567
572
You can’t perform that action at this time.
0 commit comments