New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a small bug in ApacheThriftGenBase class #4181

Merged
merged 2 commits into from Jan 13, 2017

Conversation

Projects
None yet
2 participants
@JieGhost
Contributor

JieGhost commented Jan 13, 2017

Problem

The way to consume gen_opts_map in ApacheThriftGenBase._thrift_cmd method is not correct.

Solution

Change "for item in gen_opts_map" to "for item in gen_opts_map.iteritems()"

Note

One consequence of this bug is that "new_style" option in python_thrift_library is not passed correct, causing thrift to generate old style python classes.

@JieGhost JieGhost requested a review from benjyw Jan 13, 2017

@benjyw

benjyw approved these changes Jan 13, 2017

Thanks for fixing!

@JieGhost

This comment has been minimized.

Show comment
Hide comment
@JieGhost

JieGhost Jan 13, 2017

Contributor

change iteritems to items because of this error:

T602:ERROR   src/python/pants/backend/codegen/thrift/lib/apache_thrift_gen_base.py:133 iteritems disappears in Python 3.x.  Use non-iter instead.
     |    gen_opts = [opt_str(item) for item in gen_opts_map.iteritems()]
Contributor

JieGhost commented Jan 13, 2017

change iteritems to items because of this error:

T602:ERROR   src/python/pants/backend/codegen/thrift/lib/apache_thrift_gen_base.py:133 iteritems disappears in Python 3.x.  Use non-iter instead.
     |    gen_opts = [opt_str(item) for item in gen_opts_map.iteritems()]

@JieGhost JieGhost merged commit 87833aa into pantsbuild:master Jan 13, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@JieGhost JieGhost deleted the JieGhost:yujieproject/nit_gen_thrift_py_fix branch Jan 13, 2017

lenucksi added a commit to lenucksi/pants that referenced this pull request Apr 25, 2017

fix a small bug in ApacheThriftGenBase class (#4181)
### Problem

The way to consume gen_opts_map in ApacheThriftGenBase._thrift_cmd method is not correct.

### Solution

Change "for item in gen_opts_map" to "for item in gen_opts_map.iteritems()"

### Note

One consequence of this bug is that "new_style" option in python_thrift_library is not passed correct, causing thrift to generate old style python classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment