Commit 735a66a5 authored by Ofekmeister's avatar Ofekmeister

Make import unconditional

Put import on top and updated CHANGES.rst
parent 9e11ba01
......@@ -5,6 +5,9 @@ CHANGES
v25.4.0
-------
* #459 via #736: On Windows systems, sys.argv[0] now correctly becomes the
name of entry point.
* Add Extension(py_limited_api=True). When set to a truthy value,
that extension gets a filename apropriate for code using Py_LIMITED_API.
When used correctly this allows a single compiled extension to work on
......
......@@ -2018,11 +2018,11 @@ class ScriptWriter(object):
template = textwrap.dedent("""
# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
__requires__ = %(spec)r
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
import re
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point(%(spec)r, %(group)r, %(name)r)()
......
......@@ -74,11 +74,11 @@ class TestEasyInstallTest:
expected = header + DALS("""
# EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name'
__requires__ = 'spec'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
import re
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('spec', 'console_scripts', 'name')()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment