Skip to content

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jan 24, 2018

Like the other en masse PRs, #3206 and #3220 but this one focuses on fixing Python 3 syntax errors. Each line modified in this PR is one of the following:

  • A Python 3 syntax error like old style print or old style exceptions or explicit tuples as function parameters, etc
  • from __future__ import print_function # only used where needed
  • from six.moves import xrange # should have been in from six.moves import xrange (en masse) #3206 but was hidden by a syntax error
  • from six.moves import input
  • raw_input() --> input()
  • TabError
  • explicit tuples as function parameters
  • trailing whitespace at end of line or end of file (my editor chews these up on save)

@nealwu

@tensorflow-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Contributor

@nealwu nealwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this! Two comments below.

tgt_set = set(target)
if print_out:
print "target: ", tgt_prog
print("target: ", tgt_prog)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs from __future__ import print_function above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Done.

print "--------"
print("dev set accuracy after ", i, " : ", gc / num_examples)
print(num_examples, len(data))
print("--------")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here--we need from __future__ import print_function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@nealwu nealwu merged commit c24e1f4 into tensorflow:master Jan 24, 2018
@cclauss cclauss deleted the python-3-syntax-errors branch January 24, 2018 00:43
Adrrei pushed a commit to Adrrei/models that referenced this pull request Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants