Skip to content

Commit

Permalink
Fixes 2.6 compatibility of numerous files
Browse files Browse the repository at this point in the history
Many pieces of example code or other utility modules were trying to
import print_statement from future, which does not exist. What the
developers probably meant was print_function (in common use elsewhere in
the repository).

This branch makes it so that compileall succeeds on all .py files in the
repo.
  • Loading branch information
jolynch committed Jan 29, 2014
1 parent 47d0006 commit a39aec8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion emacs/pycomplete.py
@@ -1,4 +1,4 @@
from __future__ import print_statement
from __future__ import print_function

"""
Python dot expression completion using Pymacs.
Expand Down
2 changes: 1 addition & 1 deletion examples/school/categories.py
@@ -1,4 +1,4 @@
from __future__ import print_statement
from __future__ import print_function

from words import *
from nltk.wordnet import *
Expand Down
2 changes: 1 addition & 1 deletion examples/school/parser.py
@@ -1,4 +1,4 @@
from __future__ import print_statement
from __future__ import print_function

import nltk

Expand Down
2 changes: 1 addition & 1 deletion examples/school/words.py
@@ -1,4 +1,4 @@
from __future__ import print_statement
from __future__ import print_function

import re, random

Expand Down
2 changes: 1 addition & 1 deletion examples/semantics/syn2sem.py
Expand Up @@ -4,7 +4,7 @@
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT

from __future__ import print_statement
from __future__ import print_function

"""
Demo of how to combine the output of parsing with evaluation in a model.
Expand Down
6 changes: 3 additions & 3 deletions tools/find_deprecated.py
Expand Up @@ -7,7 +7,7 @@
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT

from __future__ import print_statement
from __future__ import print_function

"""
This command-line tool takes a list of python files or directories,
Expand Down Expand Up @@ -214,10 +214,10 @@ def main():
deprecated_classes[name]).union(
deprecated_methods[name])
for msg, prefix, suffix in msgs:
print(textwrap.fill(term.RED+prefix+name+suffix+)
print(textwrap.fill(term.RED+prefix+name+suffix+
term.NORMAL+': '+msg,
width=75, initial_indent=' '*2,
subsequent_indent=' '*6)
subsequent_indent=' '*6))



Expand Down
2 changes: 1 addition & 1 deletion tools/nltk_term_index.py
@@ -1,4 +1,4 @@
from __future__ import print_statement
from __future__ import print_function

import re, sys
import nltk
Expand Down
2 changes: 1 addition & 1 deletion tools/svnmime.py
Expand Up @@ -4,7 +4,7 @@
# configured to automatically set mime types
# http://code.google.com/p/support/wiki/FAQ

from __future__ import print_statement
from __future__ import print_function

import os
import sys
Expand Down

0 comments on commit a39aec8

Please sign in to comment.