Skip to content

Commit 6173e25

Browse files
committed
Update DLR
1 parent 29308e7 commit 6173e25

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

eng/scripts/generate_casts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def mark_cls_compliance(cw, t):
8282
def generate_type_cast(cw, t):
8383
mark_cls_compliance(cw, t)
8484
cw.enter_block("public static %(type)s ExplicitCastTo%(type)s(object o)", type = t)
85-
cw.enter_block("if (o != null)")
85+
cw.enter_block("if (o is not null)")
8686
cw.write("Type type = o.GetType();");
8787

8888
cond = cw.conditions()
@@ -112,7 +112,7 @@ def generate_type_cast(cw, t):
112112
def generate_nullable_type_cast(cw, t):
113113
mark_cls_compliance(cw, t)
114114
cw.enter_block("public static Nullable<%(type)s> ExplicitCastToNullable%(type)s(object o)", type = t)
115-
cw.enter_block("if (o == null)")
115+
cw.enter_block("if (o is null)")
116116
cw.write("return new Nullable<%(type)s>();", type = t);
117117
cw.exit_block()
118118
cw.write("Type type = o.GetType();");

eng/scripts/generate_comdispatch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def gen_exposed_code_security(cw):
187187
"return null;"
188188
],
189189
setStatements=[
190-
"if (value != null) {",
190+
"if (value is not null) {",
191191
" Marshal.GetNativeVariantForObject(value, UnsafeMethods.ConvertVariantByrefToPtr(ref this));",
192192
"}"
193193
],
@@ -202,7 +202,7 @@ def gen_exposed_code_security(cw):
202202
"return null;"
203203
],
204204
setStatements=[
205-
"if (value != null) {",
205+
"if (value is not null) {",
206206
" _typeUnion._unionTypes._unknown = Marshal.GetIUnknownForObject(value);",
207207
"}"
208208
],
@@ -217,7 +217,7 @@ def gen_exposed_code_security(cw):
217217
"return null;"
218218
],
219219
setStatements=[
220-
"if (value != null) {",
220+
"if (value is not null) {",
221221
" _typeUnion._unionTypes._unknown = GetIDispatchForObject(value);",
222222
"}"
223223
],

eng/scripts/generate_dynamic_instructions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def gen_run_method(cw, n, is_void):
116116
types,
117117
','.join(param_names)))
118118

119-
cw.enter_block('if (_compiled != null || TryGetCompiled())')
119+
cw.enter_block('if (_compiled is not null || TryGetCompiled())')
120120
args = ', '.join(['arg%d' % i for i in range(n)])
121121
if is_void:
122122
cw.write('((Action%s)_compiled)(%s);' % (types, args))

eng/scripts/generate_reflected_calls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_func_type_names(i):
2626
return get_type_names(i - 1) + ['TRet']
2727

2828
def get_cast_args(i):
29-
return ['%s != null ? (%s)%s : default(%s)' % (x[0], x[1], x[0], x[1]) for x in zip(get_args(i), get_type_names(i))]
29+
return ['%s is not null ? (%s)%s : default(%s)' % (x[0], x[1], x[0], x[1]) for x in zip(get_args(i), get_type_names(i))]
3030

3131
def get_type_params(i):
3232
if i == 0: return ''
@@ -84,7 +84,7 @@ def gen_fast_creation(cw):
8484
cw.enter_block('private static CallInstruction FastCreate%s(MethodInfo target, ParameterInfo[] pi)' % get_type_params(i))
8585

8686
cw.write('Type t = TryGetParameterOrReturnType(target, pi, %d);' % (i, ))
87-
cw.enter_block('if (t == null)')
87+
cw.enter_block('if (t is null)')
8888

8989
typeArgs = ', '.join(get_type_names(i))
9090
if i == 0:

src/dlr

Submodule dlr updated 257 files

0 commit comments

Comments
 (0)