homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients amaury.forgeotdarc, belopolsky, benjamin.peterson, christian.heimes, dmi.baranov, ezio.melotti, jaraco, meador.inge, techtonik
Date 2013年08月22日.21:39:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377207543.85.0.732024068503.issue16396@psf.upfronthosting.co.za>
In-reply-to
Content
The first thing it helps is that it eliminates a ValueError on import. Without it, code must catch both ValueError and ImportError to run portably:
import ctypes
try:
 import ctypes.wintypes
except ImportError, ValueError:
 # catch ImportError and ValueError due to issue16396
 pass
...
def code_that_runs_only_on_win():
 ctypes.wintypes.foo
One _could_ cause ctypes.wintypes to always raise an ImportError on non-Windows systems, allowing the import routine to be simpler:
try:
 import ctypes.wintypes
except ImportError:
 pass
But it would be even nicer if ctypes.wintypes always imported on any platform, such that the statement could be simply:
import ctypes.wintypes
But it's conceivable that certain functionality in wintypes might be useful on other systems. Consider, for example, a routine that works with pickles produced on a Windows system, or simply a comparison of some object in ctypes.wintypes against a value produced on a Windows system.
The argument for that need (esp. on Python 2.7) is not strong, but since the patch to address the ValueError is simple, straightforward, and perhaps even simpler than something that would address the ValueError specifically, it seems worthwhile to accept the patch.
History
Date User Action Args
2013年08月22日 21:39:03jaracosetrecipients: + jaraco, amaury.forgeotdarc, belopolsky, techtonik, christian.heimes, benjamin.peterson, ezio.melotti, meador.inge, dmi.baranov
2013年08月22日 21:39:03jaracosetmessageid: <1377207543.85.0.732024068503.issue16396@psf.upfronthosting.co.za>
2013年08月22日 21:39:03jaracolinkissue16396 messages
2013年08月22日 21:39:03jaracocreate

AltStyle によって変換されたページ (->オリジナル) /