Skip to content

Commit 1d062a7

Browse files
committed
update to python 2.7.15 with data from nuget packages for x86 and x64
1 parent ac02c1a commit 1d062a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+230
-99
lines changed

PythonLib/extra/distutils/ccompiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class (via the 'executables' class attribute), but most will have:
160160
self.set_executable(key, args[key])
161161

162162
def set_executable(self, key, value):
163-
if isinstance(value, str):
163+
if isinstance(value, basestring):
164164
setattr(self, key, split_quoted(value))
165165
else:
166166
setattr(self, key, value)

PythonLib/extra/distutils/command/upload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def finalize_options(self):
5555

5656
def run(self):
5757
if not self.distribution.dist_files:
58-
raise DistutilsOptionError("No dist file created in earlier command")
58+
msg = ("Must create and upload files in one command "
59+
"(e.g. setup.py sdist upload)")
60+
raise DistutilsOptionError(msg)
5961
for command, pyversion, filename in self.distribution.dist_files:
6062
self.upload_file(command, pyversion, filename)
6163

@@ -155,8 +157,6 @@ def upload_file(self, command, pyversion, filename):
155157
body.write(fn)
156158
body.write("\r\n\r\n")
157159
body.write(value)
158-
if value and value[-1] == '\r':
159-
body.write('\n') # write an extra newline (lurve Macs)
160160
body.write(end_boundary)
161161
body = body.getvalue()
162162

PythonLib/extra/lib2to3/patcomp.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
__author__ = "Guido van Rossum <[email protected]>"
1212

1313
# Python imports
14-
import os
1514
import StringIO
1615

1716
# Fairly local imports
@@ -21,10 +20,6 @@
2120
from . import pytree
2221
from . import pygram
2322

24-
# The pattern grammar file
25-
_PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
26-
"PatternGrammar.txt")
27-
2823

2924
class PatternSyntaxError(Exception):
3025
pass
@@ -42,13 +37,17 @@ def tokenize_wrapper(input):
4237

4338
class PatternCompiler(object):
4439

45-
def __init__(self, grammar_file=_PATTERN_GRAMMAR_FILE):
40+
def __init__(self, grammar_file=None):
4641
"""Initializer.
4742
4843
Takes an optional alternative filename for the pattern grammar.
4944
"""
50-
self.grammar = driver.load_grammar(grammar_file)
51-
self.syms = pygram.Symbols(self.grammar)
45+
if grammar_file is None:
46+
self.grammar = pygram.pattern_grammar
47+
self.syms = pygram.pattern_symbols
48+
else:
49+
self.grammar = driver.load_grammar(grammar_file)
50+
self.syms = pygram.Symbols(self.grammar)
5251
self.pygrammar = pygram.python_grammar
5352
self.pysyms = pygram.python_symbols
5453
self.driver = driver.Driver(self.grammar, convert=pattern_convert)

PythonLib/extra/lib2to3/pgen2/driver.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import codecs
2020
import os
2121
import logging
22+
import pkgutil
2223
import StringIO
2324
import sys
2425

@@ -143,6 +144,26 @@ def _newer(a, b):
143144
return os.path.getmtime(a) >= os.path.getmtime(b)
144145

145146

147+
def load_packaged_grammar(package, grammar_source):
148+
"""Normally, loads a pickled grammar by doing
149+
pkgutil.get_data(package, pickled_grammar)
150+
where *pickled_grammar* is computed from *grammar_source* by adding the
151+
Python version and using a ``.pickle`` extension.
152+
153+
However, if *grammar_source* is an extant file, load_grammar(grammar_source)
154+
is called instead. This facilitates using a packaged grammar file when needed
155+
but preserves load_grammar's automatic regeneration behavior when possible.
156+
157+
"""
158+
if os.path.isfile(grammar_source):
159+
return load_grammar(grammar_source)
160+
pickled_name = _generate_pickle_name(os.path.basename(grammar_source))
161+
data = pkgutil.get_data(package, pickled_name)
162+
g = grammar.Grammar()
163+
g.loads(data)
164+
return g
165+
166+
146167
def main(*args):
147168
"""Main program, when run as a script: produce grammar pickle files.
148169

PythonLib/extra/lib2to3/pgen2/grammar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def load(self, filename):
109109
f.close()
110110
self.__dict__.update(d)
111111

112+
def loads(self, pkl):
113+
"""Load the grammar tables from a pickle bytes object."""
114+
self.__dict__.update(pickle.loads(pkl))
115+
112116
def copy(self):
113117
"""
114118
Copy the grammar.

PythonLib/extra/lib2to3/pygram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def __init__(self, grammar):
2929
setattr(self, name, symbol)
3030

3131

32-
python_grammar = driver.load_grammar(_GRAMMAR_FILE)
32+
python_grammar = driver.load_packaged_grammar("lib2to3", _GRAMMAR_FILE)
3333

3434
python_symbols = Symbols(python_grammar)
3535

3636
python_grammar_no_print_statement = python_grammar.copy()
3737
del python_grammar_no_print_statement.keywords["print"]
3838

39-
pattern_grammar = driver.load_grammar(_PATTERN_GRAMMAR_FILE)
39+
pattern_grammar = driver.load_packaged_grammar("lib2to3", _PATTERN_GRAMMAR_FILE)
4040
pattern_symbols = Symbols(pattern_grammar)

PythonLib/extra_dll/_bsddb.pyd

0 Bytes
Binary file not shown.

PythonLib/extra_dll_x64/_bsddb.pyd

0 Bytes
Binary file not shown.

PythonLib/full/_threading_local.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@
5757
5858
>>> class MyLocal(local):
5959
... number = 2
60-
... initialized = False
6160
... def __init__(self, **kw):
62-
... if self.initialized:
63-
... raise SystemError('__init__ called too many times')
64-
... self.initialized = True
6561
... self.__dict__.update(kw)
6662
... def squared(self):
6763
... return self.number ** 2
@@ -98,7 +94,7 @@
9894
>>> thread.start()
9995
>>> thread.join()
10096
>>> log
101-
[[('color', 'red'), ('initialized', True)], 11]
97+
[[('color', 'red')], 11]
10298
10399
without affecting this thread's data:
104100

PythonLib/full/aifc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ def initfp(self, file):
308308
else:
309309
raise Error, 'not an AIFF or AIFF-C file'
310310
self._comm_chunk_read = 0
311+
self._ssnd_chunk = None
311312
while 1:
312313
self._ssnd_seek_needed = 1
313314
try:

0 commit comments

Comments
 (0)