174 errors), the message, a list with arguments for the message) |
174 errors), the message, a list with arguments for the message) |
175 @rtype dict |
175 @rtype dict |
176 """ |
176 """ |
177 try: |
177 try: |
178 import tomlkit |
178 import tomlkit |
179 from tomlkit.exceptions import ParseError, KeyAlreadyPresent |
179 |
|
180 from tomlkit.exceptions import KeyAlreadyPresent, ParseError |
180 except ImportError: |
181 except ImportError: |
181 error = "tomlkit not available. Install it via the PyPI interface." |
182 error = "tomlkit not available. Install it via the PyPI interface." |
182 return [{"error": (file, 0, 0, "", error)}] |
183 return [{"error": (file, 0, 0, "", error)}] |
183 |
184 |
184 codestring = normalizeCode(codestring) |
185 codestring = normalizeCode(codestring) |