Skip to content
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

bpo-29919: Remove unused imports found by pyflakes #137

Merged
merged 1 commit into from Mar 27, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Feb 16, 2017

Make also minor PEP8 coding style fixes on modified imports.

http://bugs.python.org/issue29919

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Please open an issue on the tracker. This is enough large change.

@@ -9,8 +9,7 @@
get_tk_patchlevel, widget_eq)
from tkinter.test.widget_tests import (
add_standard_options, noconv, pixels_round,
AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests,
setUpModule)
Copy link
Member

@serhiy-storchaka serhiy-storchaka Feb 16, 2017

Choose a reason for hiding this comment

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

setUpModule should be imported in the module namespace!

Copy link
Member Author

@vstinner vstinner Mar 27, 2017

Choose a reason for hiding this comment

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

fixed

@@ -8,8 +8,7 @@
from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
simulate_mouse_click)
from tkinter.test.widget_tests import (add_standard_options, noconv,
AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests,
setUpModule)
Copy link
Member

@serhiy-storchaka serhiy-storchaka Feb 16, 2017

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member Author

@vstinner vstinner Mar 27, 2017

Choose a reason for hiding this comment

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

fixed

@@ -13,6 +13,6 @@

__unittest = True

from .main import main, TestProgram
Copy link
Member

@serhiy-storchaka serhiy-storchaka Feb 16, 2017

Choose a reason for hiding this comment

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

This looks suspicious. Are you sure that TestProgram is not needed?

Copy link
Member Author

@vstinner vstinner Feb 16, 2017

Choose a reason for hiding this comment

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

Lib/unittest/main.py ends with "main = TestProgram". And TestProgram is not used in Lib/unittest/main.py.

@@ -5,7 +5,7 @@
'''
import unittest
from test.support import requires
from tkinter import Tk, Toplevel, Frame ##, BooleanVar, StringVar
from tkinter import Tk, Frame ##, BooleanVar, StringVar
Copy link
Member

@serhiy-storchaka serhiy-storchaka Feb 16, 2017

Choose a reason for hiding this comment

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

Why BooleanVar and StringVar are commented out?

Copy link
Member Author

@vstinner vstinner Feb 16, 2017

Choose a reason for hiding this comment

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

They are used in commented code a few lines below. I don't want to remove this commented code, since I don't know this file.

@orsenthil
Copy link
Member

orsenthil commented Feb 16, 2017

Here was my basis for approval. The change is an automated one using pyflakes and our unit-tests are successful. I could not spot anything critical after looking at the diff. ( That is, if things would have broken by removal of top-level imports, then we should have seen when the module was invoked).

@warsaw
Copy link
Member

warsaw commented Feb 17, 2017

Gosh I'd love to enable flake8 on the stdlib, since it often causes my eyes to bleed red when I open a py file from the stdlib. But I suppose that will just cause unnecessary code churn. It's still nice to clean things up when you can, like unused imports.

@vstinner
Copy link
Member Author

vstinner commented Feb 18, 2017

@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Feb 18, 2017
@vstinner vstinner changed the title Remove unused imports found by pyflakes bpo-29919: Remove unused imports found by pyflakes Mar 27, 2017
Make also minor PEP8 coding style fixes on modified imports.
@vstinner
Copy link
Member Author

vstinner commented Mar 27, 2017

I rebased my patch and removed the two changes removing setUpModule() :-)

@vstinner
Copy link
Member Author

vstinner commented Mar 27, 2017

@serhiy-storchaka: "Please open an issue on the tracker. This is enough large change."

I don't see the value added by creating an issue, but ok, I created http://bugs.python.org/issue29919 :-)

@vstinner vstinner merged commit d6debb2 into python:master Mar 27, 2017
2 of 3 checks passed
@vstinner
Copy link
Member Author

vstinner commented Mar 27, 2017

Thanks for the reviews!

@vstinner vstinner deleted the unused_imports branch Mar 27, 2017
terryjreedy added a commit that referenced this issue Jun 11, 2017
Part of patch by Victor Stinner.
(cherry-pick from d6debb2)
akruis pushed a commit to akruis/cpython that referenced this issue Oct 22, 2017
Add Stackless support to all call-API-functions in abstract.c
akruis pushed a commit to akruis/cpython that referenced this issue Oct 22, 2017
Add Stackless support to _PyObject_FastCallKeywords() and
_PyFunction_FastCallKeywords.
akruis pushed a commit to akruis/cpython that referenced this issue Oct 29, 2017
Add Stackless support to _PyObject_Call_Prepend().
akruis pushed a commit to akruis/cpython that referenced this issue Oct 29, 2017
- Add Stackless support to _PyObject_FastCallKeywords().
- Use STACKLESS_PROPOSE_... in a consistent way.
akruis pushed a commit to akruis/cpython that referenced this issue Oct 29, 2017
Add Stackless support to _PyCFunction_FastCallKeywords().
akruis pushed a commit to akruis/cpython that referenced this issue Oct 29, 2017
Add Stackless support for METH_FASTCALL C-functions.
Add a warning about the ABI change to the Stackless changelog.
akruis pushed a commit to akruis/cpython that referenced this issue Oct 29, 2017
akruis pushed a commit to akruis/cpython that referenced this issue Mar 25, 2018
Add Stackless support to _PyObject_CallFunctionVa() and related
functions.
akruis pushed a commit to akruis/cpython that referenced this issue Mar 25, 2018
Fix Stackless support of _PyCFunction_FastCallKeywords().
akruis pushed a commit to akruis/cpython that referenced this issue Mar 25, 2018
Add Stackless support to _PyMethodDescr_FastCallKeywords().
akruis pushed a commit to akruis/cpython that referenced this issue Mar 25, 2018
Add Stackless support to cfunction_call_varargs().
akruis pushed a commit to akruis/cpython that referenced this issue Mar 25, 2018
Add Stackless support to function _PyObject_FastCall_Prepend().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants