diff --git a/examples/python/CMakeLists.txt b/examples/python/CMakeLists.txt index 6717165418..5f88462606 100644 --- a/examples/python/CMakeLists.txt +++ b/examples/python/CMakeLists.txt @@ -4,6 +4,7 @@ endif() file(GLOB PYTHON_SRCS "*.py") # Remove too long examples +list(FILTER PYTHON_SRCS EXCLUDE REGEX ".*/line_balancing_sat.py") # need input file list(FILTER PYTHON_SRCS EXCLUDE REGEX ".*/arc_flow_cutting_stock_sat.py") # too long list(FILTER PYTHON_SRCS EXCLUDE REGEX ".*/bus_driver_scheduling_sat.py") # too long list(FILTER PYTHON_SRCS EXCLUDE REGEX ".*/cover_rectangle_sat.py") # too long diff --git a/examples/python/line_balancing_sat.py b/examples/python/line_balancing_sat.py old mode 100644 new mode 100755 index 9bf8e629b8..96079397d7 --- a/examples/python/line_balancing_sat.py +++ b/examples/python/line_balancing_sat.py @@ -340,6 +340,8 @@ def solve_scheduling_model(model, hint): def main(argv: Sequence[str]) -> None: if len(argv) > 1: raise app.UsageError('Too many command-line arguments.') + if FLAGS.input == '': + raise app.UsageError('Missing input file.') model = read_model(FLAGS.input) print_stats(model)