Skip to content

Commit 2130561

Browse files
committed
allow running without main file
1 parent f4b36c7 commit 2130561

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

python/code/wypp/runner.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ def main(globals, argList=None):
6565
printStderr(f'Unsupported language {args.lang}. Supported: ' + ', '.join(i18n.allLanguages))
6666
sys.exit(1)
6767

68-
fileToRun: str = args.file
68+
isInteractive = args.interactive
69+
version = versionMod.readVersion()
70+
fileToRun: str|None = args.file
71+
if fileToRun is None:
72+
if args.repls:
73+
import replTester
74+
replTester.testRepls(args.repls, globals)
75+
return
6976
if not os.path.exists(fileToRun):
7077
printStderr(f'File {fileToRun} does not exist')
7178
sys.exit(1)
@@ -75,11 +82,6 @@ def main(globals, argList=None):
7582
fileToRun = os.path.basename(fileToRun)
7683
debug(f'Changed directory to {d}, fileToRun={fileToRun}')
7784

78-
isInteractive = args.interactive
79-
version = versionMod.readVersion()
80-
81-
if fileToRun is None:
82-
return
8385

8486
if not args.checkRunnable and (not args.quiet or args.verbose):
8587
printWelcomeString(fileToRun, version, doTypecheck=args.checkTypes)

0 commit comments

Comments
 (0)