You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran python through a debugger and found that the exceptions module is
imported automatically at load time. Because of this, when "import
exceptions" is parsed, the module is already loaded, and PyImport_Import
is not called. In order to correct this, we'll have to either catch
this at the AST, or just handle it in 2to3...
I'm not sure how we could implement a warning on import of exceptions
aside from implementing it in the compiler. I suppose 2to3 could just
remove the import...
I'm not sure how we could implement a warning on import of exceptions
aside from implementing it in the compiler. I suppose 2to3 could just
remove the import...
... and would also have to change all references. But that would
probably work out fine.
Given that this is now a request for a fixer, and not a request for a
deprecation warning, I don't see why this is considered a release
blocker. Lowering the priority to normal. Even if the fixer isn't added
to the 2to3 copy shipped with 2.6.0, I think 2to3 improvements can well
be incorporated into 2.6.1 (including additional fixers).
I've converted Benjamin's patch to extended diff format, fixed some PEP-8 violations and typos, removed the {get, set}_prefix usage, added
more tests and updated the documentation.
Activity
brettcannon commentedon Mar 17, 2008
Importing 'exceptions' should raise at least a Py3K warning, if not a
full DeprecationWarning.
douglas commentedon Mar 17, 2008
I ran python through a debugger and found that the exceptions module is
imported automatically at load time. Because of this, when "import
exceptions" is parsed, the module is already loaded, and PyImport_Import
is not called. In order to correct this, we'll have to either catch
this at the AST, or just handle it in 2to3...
benjaminp commentedon Aug 24, 2008
I'm not sure how we could implement a warning on import of exceptions
aside from implementing it in the compiler. I suppose 2to3 could just
remove the import...
brettcannon commentedon Aug 24, 2008
On Sun, Aug 24, 2008 at 2:51 PM, Benjamin Peterson
<report@bugs.python.org> wrote:
... and would also have to change all references. But that would
probably work out fine.
benjaminp commentedon Aug 25, 2008
Here's my 2to3 fixer for the job. It cleanly removes the imports and
changes the usage.
[-]Warn against importing 'exceptions'[/-][+]'exceptions' import fixer[/+]1 remaining item
loewis commentedon Sep 10, 2008
Given that this is now a request for a fixer, and not a request for a
deprecation warning, I don't see why this is considered a release
blocker. Lowering the priority to normal. Even if the fixer isn't added
to the 2to3 copy shipped with 2.6.0, I think 2to3 improvements can well
be incorporated into 2.6.1 (including additional fixers).
loewis commentedon Oct 12, 2012
Brett: Why did you close the issue? Benjamin's change was never committed...
brettcannon commentedon Oct 12, 2012
I don't remember.
berkerpeksag commentedon Dec 30, 2012
I've converted Benjamin's patch to extended diff format, fixed some
PEP-8 violations and typos, removed the {get, set}_prefix usage, added
more tests and updated the documentation.
benjaminp commentedon Dec 30, 2012
This is something people can easily convert in there 2.x code, so I don't think the need for it is great.
iritkatriel commentedon Oct 22, 2020
Updating the versions, though it seems that you may want to close this as rejected based on the discussion.