File: 08-drop-old-external-toml.patch

package info (click to toggle)
cvc4 1.8-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 70,008 kB
  • sloc: cpp: 274,686; sh: 5,836; python: 1,894; java: 929; lisp: 763; ansic: 275; perl: 214; makefile: 22; awk: 2
file content (41 lines) | stat: -rw-r--r-- 1,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- a/src/options/CMakeLists.txt
+++ b/src/options/CMakeLists.txt
@@ -1,17 +1,3 @@
-# Check if the toml Python module is installed.
-execute_process(
-  COMMAND
-  ${PYTHON_EXECUTABLE} -c "import toml"
-  RESULT_VARIABLE
-    RET_TOML
-  ERROR_QUIET
-)
-
-if(RET_TOML)
-    message(FATAL_ERROR
-      "Could not find Python module toml. Install via `pip install toml'.")
-endif()
-
 libcvc4_add_sources(
   base_handlers.h
   decision_weight.h
--- a/src/options/mkoptions.py
+++ b/src/options/mkoptions.py
@@ -46,7 +46,7 @@
 import re
 import sys
 import textwrap
-import toml
+import tomllib
 
 ### Allowed attributes for module/option/alias
 
@@ -1309,7 +1309,8 @@
     # Parse files, check attributes and create module/option objects
     modules = []
     for filename in filenames:
-        module = parse_module(filename, toml.load(filename))
+        with open(filename, 'rb') as fd:
+            module = parse_module(filename, tomllib.load(fd))
 
         # Check if long options are valid and unique.  First populate
         # g_long_cache with option.long and --no- alternatives if