Commit bbf77970 authored by Brett Cannon's avatar Brett Cannon

Remove more '<>' usage.

``python -m compileall -f`` is really handy for finding Python files that use
invalid syntax.
parent 465e5b08
...@@ -167,9 +167,9 @@ def checkarg(type, arg): ...@@ -167,9 +167,9 @@ def checkarg(type, arg):
raise arg_error, ('\'*\' expected', sub) raise arg_error, ('\'*\' expected', sub)
if sub == 'retval': if sub == 'retval':
# size is retval -- must be a reply argument # size is retval -- must be a reply argument
if mode <> 'r': if mode != 'r':
raise arg_error, ('non-r mode with [retval]', mode) raise arg_error, ('non-r mode with [retval]', mode)
elif not isnum(sub) and (sub[:3] <> 'arg' or not isnum(sub[3:])): elif not isnum(sub) and (sub[:3] != 'arg' or not isnum(sub[3:])):
raise arg_error, ('bad subscript', sub) raise arg_error, ('bad subscript', sub)
# #
return type, mode, num, sub return type, mode, num, sub
...@@ -218,7 +218,7 @@ def generate(type, func, database): ...@@ -218,7 +218,7 @@ def generate(type, func, database):
# #
# Declare return value if any # Declare return value if any
# #
if type <> 'void': if type != 'void':
print '\t' + type, 'retval;' print '\t' + type, 'retval;'
# #
# Declare arguments # Declare arguments
...@@ -283,7 +283,7 @@ def generate(type, func, database): ...@@ -283,7 +283,7 @@ def generate(type, func, database):
print '(!geti' + xtype + 'arraysize(args,', print '(!geti' + xtype + 'arraysize(args,',
print repr(n_in_args) + ',', print repr(n_in_args) + ',',
print repr(in_pos[j]) + ',', print repr(in_pos[j]) + ',',
if xtype <> a_type: if xtype != a_type:
print '('+xtype+' *)', print '('+xtype+' *)',
print '&arg' + repr(i+1) + '))' print '&arg' + repr(i+1) + '))'
print '\t\treturn NULL;' print '\t\treturn NULL;'
...@@ -311,21 +311,21 @@ def generate(type, func, database): ...@@ -311,21 +311,21 @@ def generate(type, func, database):
if a_factor and a_sub: print '*', if a_factor and a_sub: print '*',
if a_sub: print a_sub, if a_sub: print a_sub,
print ',', print ',',
if (a_sub and a_factor) or xtype <> a_type: if (a_sub and a_factor) or xtype != a_type:
print '('+xtype+' *)', print '('+xtype+' *)',
print 'arg' + repr(i+1) + '))' print 'arg' + repr(i+1) + '))'
else: # Get a simple variable else: # Get a simple variable
print '(!geti' + xtype + 'arg(args,', print '(!geti' + xtype + 'arg(args,',
print repr(n_in_args) + ',', print repr(n_in_args) + ',',
print repr(in_pos[i]) + ',', print repr(in_pos[i]) + ',',
if xtype <> a_type: if xtype != a_type:
print '('+xtype+' *)', print '('+xtype+' *)',
print '&arg' + repr(i+1) + '))' print '&arg' + repr(i+1) + '))'
print '\t\treturn NULL;' print '\t\treturn NULL;'
# #
# Begin of function call # Begin of function call
# #
if type <> 'void': if type != 'void':
print '\tretval =', func + '(', print '\tretval =', func + '(',
else: else:
print '\t' + func + '(', print '\t' + func + '(',
...@@ -356,7 +356,7 @@ def generate(type, func, database): ...@@ -356,7 +356,7 @@ def generate(type, func, database):
# #
# Multiple return values -- construct a tuple # Multiple return values -- construct a tuple
# #
if type <> 'void': if type != 'void':
n_out_args = n_out_args + 1 n_out_args = n_out_args + 1
if n_out_args == 1: if n_out_args == 1:
for i in range(len(database)): for i in range(len(database)):
...@@ -372,7 +372,7 @@ def generate(type, func, database): ...@@ -372,7 +372,7 @@ def generate(type, func, database):
print n_out_args, ');' print n_out_args, ');'
print '\t if (v == NULL) return NULL;' print '\t if (v == NULL) return NULL;'
i_out = 0 i_out = 0
if type <> 'void': if type != 'void':
print '\t PyTuple_SetItem(v,', print '\t PyTuple_SetItem(v,',
print repr(i_out) + ',', print repr(i_out) + ',',
print mkobject(type, 'retval') + ');' print mkobject(type, 'retval') + ');'
...@@ -489,7 +489,7 @@ while 1: ...@@ -489,7 +489,7 @@ while 1:
elif len(words) < 2: elif len(words) < 2:
err('Line', lno, ': no funcname :', line) err('Line', lno, ': no funcname :', line)
else: else:
if len(words) % 2 <> 0: if len(words) % 2 != 0:
err('Line', lno, ': odd argument list :', words[2:]) err('Line', lno, ': odd argument list :', words[2:])
else: else:
database = [] database = []
......
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