Skip to content

Commit

Permalink
Update bro.py: Fix undefined name in Python code
Browse files Browse the repository at this point in the history
`outfile` is used before it is defined on the following line so use `options.outfile` instead.

% `ruff check`
```
Error: python/bro.py:168:64: F821 Undefined name `outfile`
```
  • Loading branch information
cclauss authored Jan 9, 2025
1 parent 67d78bc commit 0ffb940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/bro.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def main(args=None):
# redirect the write according to symlink.
if os.path.exists(options.outfile) and not options.force:
parser.error(('Target --outfile=%s already exists, '
'but --force was not requested.') % (outfile,))
'but --force was not requested.') % (options.outfile,))
outfile = open(options.outfile, 'wb')
did_open_outfile = True
else:
Expand Down

0 comments on commit 0ffb940

Please sign in to comment.