Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eng/scripts/CompareDirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ def compare_dirs(dir1, dir2):

def main():
if len(sys.argv)!=3:
print 'Usage: CompareDirs <dir1> <dir2>'
print('Usage: CompareDirs <dir1> <dir2>')
sys.exit(-1)

if compare_dirs(sys.argv[1],sys.argv[2]):
print "The directories are identical"
print("The directories are identical")
sys.exit(0)
else: #the part that differed is explained via dircmp.report() above
print "The directories differ"
print("The directories differ")
sys.exit(1)

if __name__=="__main__":
Expand Down
2 changes: 1 addition & 1 deletion eng/scripts/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def do_dir(dirname):
if os.path.isdir(filename):
do_dir(filename)
elif is_binary(filename):
print 'deleting', filename
print('deleting', filename)
os.remove(filename)

TOP_DIR = "c:\\IronPython-0.7"
Expand Down
6 changes: 3 additions & 3 deletions eng/scripts/copyrights.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@
def add_header(filename, old_header, new_header):
text = open(filename, 'r').read()
if text.startswith(old_header):
print "replacing header", filename
print("replacing header", filename)
text = new_header + text[len(old_header):]
open(filename, 'w').write(text)
elif not text.startswith(new_header):
print 'no old header', filename
print('no old header', filename)
text = new_header + "\n" + text
open(filename, 'w').write(text)

def do_dir(dirname):
import os
for file in os.listdir(dirname):
print "Processing:", file
print("Processing:", file)
if file == "ExternalCode": continue
filename = os.path.join(dirname, file)
if os.path.isdir(filename):
Expand Down
4 changes: 2 additions & 2 deletions eng/scripts/make_meta1.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(self, name, super_name, methods):
self.strings = {}

def get_constant_string(self, s):
if not self.strings.has_key(s):
if s not in self.strings:
self.strings[s] = s + "_str"

return self.strings[s]
Expand Down Expand Up @@ -235,7 +235,7 @@ def collect_methods(text):
#if c.super_name != 'PyModule':
# assert c.super_name == base.name, c.super_name

print c, c.methods
print(c, c.methods)
code = c.make_any_methods()
code.insert(0, START)
code.append(END)
Expand Down
12 changes: 6 additions & 6 deletions eng/scripts/radix_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.

max_uint = 0xffffffffl
print max_uint
max_uint = 0xffffffff
print(max_uint)

digits = ['0','0']
radii = ['0','0']
for i in range(2, 37):
p = 1
while i**(p+1) <= max_uint:
p = p+1
print i, p, i**p
print(i, p, i**p)
digits.append(str(p))
radii.append(str(i**p))
print digits, radii
print(digits, radii)

print ", ".join(digits)
print ", ".join(radii)
print(", ".join(digits))
print(", ".join(radii))

6 changes: 3 additions & 3 deletions eng/scripts/run_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

def main():
if len(sys.argv) != 2:
print "Usage: ipy run_compiled.py <testfile.py>"
print("Usage: ipy run_compiled.py <testfile.py>")
sys.exit(-1)

testName = sys.argv[1]

print "Compiling ", testName ,"..."
print("Compiling ", testName ,"...")
clr.CompileModules("compiledTest.dll", testName)
File.Move(testName, testName+".bak")
try:
print "Running test from compiled binary..."
print("Running test from compiled binary...")
clr.AddReference("compiledTest")
__import__(Path.GetFileNameWithoutExtension(testName))
finally:
Expand Down
14 changes: 7 additions & 7 deletions eng/scripts/run_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ def run_interactive_main():
if testName:
testsToRun = Directory.GetFiles(Directory.GetCurrentDirectory() , testName)
else:
print "No test name provided"
print("No test name provided")
sys.exit(-1)

allErrors = []
for test in testsToRun:
try:
print "\nRunning test in interactive mode - ", test
print("\nRunning test in interactive mode - ", test)
con = FileConsole(test)
con.Run()
except Exception, e:
print e, e.clsException
except Exception as e:
print(e, e.clsException)
allErrors.append((test, sys.exc_info()[0], sys.exc_info()[1]))

if(allErrors):
print "\n##################################################################################"
print "Summary of all errors"
print("\n##################################################################################")
print("Summary of all errors")
for file, type, message in allErrors:
print file, type, message
print(file, type, message)
sys.exit(len(allErrors))

#--------------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions eng/scripts/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
newline = os.linesep

pats = [0L, 1L, 42L, 0x7fffffffL, 0x80000000L, 0xabcdef01L, 0xffffffffL]
pats = [0, 1, 42, 0x7fffffff, 0x80000000, 0xabcdef01, 0xffffffff]
nums = []
for p0 in pats:
for p1 in pats:
Expand All @@ -23,7 +23,7 @@
bignums.append(n)
bignums.append(-n)
#!!! should add 2 or 3 larger numbers to check for any issues there
print len(bignums), len(bignums)**2
print(len(bignums), len(bignums)**2)



Expand All @@ -40,15 +40,15 @@
]

def buildit(name, nums):
print 'expected', (len(nums)**2)*len(ops)
print('expected', (len(nums)**2)*len(ops))
t0 = time.clock()

for sym, op in ops:
if not name.startswith('time'):
fp = open('%s_%s.txt' % (name, op.__name__), 'w')
else:
fp = None
print 'computing', sym
print('computing', sym)
for x in nums:
for y in nums:
try:
Expand All @@ -63,7 +63,7 @@ def buildit(name, nums):
fp.write('ERROR' + newline)
if fp: fp.close()
t1 = time.clock()
print 'time', (t1-t0)
print('time', (t1-t0))

buildit('time1', bignums)
buildit('short', nums)
Expand Down