File tree 1 file changed +9
-9
lines changed 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -494,19 +494,19 @@ def shell_command():
494
494
495
495
496
496
def main (as_module = False ):
497
- this_module = __package__ + '.cli'
498
497
args = sys .argv [1 :]
499
498
500
499
if as_module :
501
- if sys .version_info >= (2 , 7 ):
502
- name = 'python -m ' + this_module .rsplit ('.' , 1 )[0 ]
503
- else :
504
- name = 'python -m ' + this_module
500
+ this_module = 'flask'
501
+
502
+ if sys .version_info < (2 , 7 ):
503
+ this_module += '.cli'
504
+
505
+ name = 'python -m ' + this_module
505
506
506
- # This module is always executed as "python -m flask.run" and as such
507
- # we need to ensure that we restore the actual command line so that
508
- # the reloader can properly operate.
509
- sys .argv = ['-m' , this_module ] + sys .argv [1 :]
507
+ # Python rewrites "python -m flask" to the path to the file in argv.
508
+ # Restore the original command so that the reloader works.
509
+ sys .argv = ['-m' , this_module ] + args
510
510
else :
511
511
name = None
512
512
You can’t perform that action at this time.
0 commit comments