|
24 | 24 | import sys
|
25 | 25 | import tempfile
|
26 | 26 | import traceback
|
27 |
| -import urllib.request |
28 | 27 | from dataclasses import dataclass
|
29 | 28 | from pathlib import Path
|
30 | 29 | from typing import Optional
|
@@ -195,7 +194,7 @@ def matterPathFromZapPath(zap_config_path):
|
195 | 194 | if not target_path.endswith(".matter"):
|
196 | 195 | # We expect "something.zap" and don't handle corner cases of
|
197 | 196 | # multiple extensions. This is to work with existing codebase only
|
198 |
| - raise Error("Unexpected input zap file %s" % self.zap_config) |
| 197 | + raise Exception("Unexpected input zap file %s" % zap_config_path) |
199 | 198 |
|
200 | 199 | return target_path
|
201 | 200 |
|
@@ -290,7 +289,7 @@ def getClangFormatBinary():
|
290 | 289 | print('WARNING: clang-format may not be the right version:')
|
291 | 290 | print(' PIGWEED TAG: %s' % clang_config['tags'][0])
|
292 | 291 | print(' ACTUAL VERSION: %s' % version_string)
|
293 |
| - except: |
| 292 | + except Exception: |
294 | 293 | print("Failed to validate clang version.")
|
295 | 294 | traceback.print_last()
|
296 | 295 |
|
@@ -318,12 +317,11 @@ def runClangPrettifier(templates_file, output_dir):
|
318 | 317 | args = [clang_format, '-i']
|
319 | 318 | args.extend(clangOutputs)
|
320 | 319 | subprocess.check_call(args)
|
321 |
| - err = None |
322 | 320 | print('Formatted using %s (%s)' % (clang_format, subprocess.check_output([clang_format, '--version'])))
|
323 | 321 | for outputName in clangOutputs:
|
324 | 322 | print(' - %s' % outputName)
|
325 |
| - except Exception as err: |
326 |
| - print('clang-format error:', err) |
| 323 | + except subprocess.CalledProcessError as err: |
| 324 | + print('clang-format error: %s', err) |
327 | 325 |
|
328 | 326 |
|
329 | 327 | class LockFileSerializer:
|
@@ -351,7 +349,7 @@ def main():
|
351 | 349 | checkPythonVersion()
|
352 | 350 | cmdLineArgs = runArgumentsParser()
|
353 | 351 |
|
354 |
| - with LockFileSerializer(cmdLineArgs.lock_file) as lock: |
| 352 | + with LockFileSerializer(cmdLineArgs.lock_file) as _: |
355 | 353 | if cmdLineArgs.runBootstrap:
|
356 | 354 | subprocess.check_call(getFilePath("scripts/tools/zap/zap_bootstrap.sh"), shell=True)
|
357 | 355 |
|
|
0 commit comments