Skip to content

Commit

Permalink
Fix undefined name:: ‘l’ —> “orig_line‘ (#75)
Browse files Browse the repository at this point in the history
__l__ is an undefined name in this context.  In the error message we want to show the user the original line.

flake8 testing of https://github.com/ros/genmsg on Python 2.7.14

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./src/genmsg/msg_loader.py:206:69: F821 undefined name 'l'
            raise InvalidMsgSpec("Invalid constant declaration: %s"%l)
                                                                    ^
1     F821 undefined name 'l
```
  • Loading branch information
cclauss authored and dirk-thomas committed Mar 13, 2018
1 parent 0bfdc5a commit cb02cec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/genmsg/msg_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _load_constant_line(orig_line):
else:
line_splits = [x.strip() for x in ' '.join(line_splits[1:]).split(CONSTCHAR)] #resplit on '='
if len(line_splits) != 2:
raise InvalidMsgSpec("Invalid constant declaration: %s"%l)
raise InvalidMsgSpec("Invalid constant declaration: %s"%orig_line)
name = line_splits[0]
val = line_splits[1]

Expand Down

0 comments on commit cb02cec

Please sign in to comment.