From 6173e2575d316baddab89f3ca659bc4928b475dd Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Tue, 3 Mar 2026 15:08:40 -0800 Subject: [PATCH] Update DLR --- eng/scripts/generate_casts.py | 4 ++-- eng/scripts/generate_comdispatch.py | 6 +++--- eng/scripts/generate_dynamic_instructions.py | 2 +- eng/scripts/generate_reflected_calls.py | 4 ++-- src/dlr | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/scripts/generate_casts.py b/eng/scripts/generate_casts.py index 79cb0e3ee..4d16e0f5b 100644 --- a/eng/scripts/generate_casts.py +++ b/eng/scripts/generate_casts.py @@ -82,7 +82,7 @@ def mark_cls_compliance(cw, t): def generate_type_cast(cw, t): mark_cls_compliance(cw, t) cw.enter_block("public static %(type)s ExplicitCastTo%(type)s(object o)", type = t) - cw.enter_block("if (o != null)") + cw.enter_block("if (o is not null)") cw.write("Type type = o.GetType();"); cond = cw.conditions() @@ -112,7 +112,7 @@ def generate_type_cast(cw, t): def generate_nullable_type_cast(cw, t): mark_cls_compliance(cw, t) cw.enter_block("public static Nullable<%(type)s> ExplicitCastToNullable%(type)s(object o)", type = t) - cw.enter_block("if (o == null)") + cw.enter_block("if (o is null)") cw.write("return new Nullable<%(type)s>();", type = t); cw.exit_block() cw.write("Type type = o.GetType();"); diff --git a/eng/scripts/generate_comdispatch.py b/eng/scripts/generate_comdispatch.py index 947a7b9c1..e3a52c670 100644 --- a/eng/scripts/generate_comdispatch.py +++ b/eng/scripts/generate_comdispatch.py @@ -187,7 +187,7 @@ def gen_exposed_code_security(cw): "return null;" ], setStatements=[ - "if (value != null) {", + "if (value is not null) {", " Marshal.GetNativeVariantForObject(value, UnsafeMethods.ConvertVariantByrefToPtr(ref this));", "}" ], @@ -202,7 +202,7 @@ def gen_exposed_code_security(cw): "return null;" ], setStatements=[ - "if (value != null) {", + "if (value is not null) {", " _typeUnion._unionTypes._unknown = Marshal.GetIUnknownForObject(value);", "}" ], @@ -217,7 +217,7 @@ def gen_exposed_code_security(cw): "return null;" ], setStatements=[ - "if (value != null) {", + "if (value is not null) {", " _typeUnion._unionTypes._unknown = GetIDispatchForObject(value);", "}" ], diff --git a/eng/scripts/generate_dynamic_instructions.py b/eng/scripts/generate_dynamic_instructions.py index 4a61969d5..8e496e560 100644 --- a/eng/scripts/generate_dynamic_instructions.py +++ b/eng/scripts/generate_dynamic_instructions.py @@ -116,7 +116,7 @@ def gen_run_method(cw, n, is_void): types, ','.join(param_names))) - cw.enter_block('if (_compiled != null || TryGetCompiled())') + cw.enter_block('if (_compiled is not null || TryGetCompiled())') args = ', '.join(['arg%d' % i for i in range(n)]) if is_void: cw.write('((Action%s)_compiled)(%s);' % (types, args)) diff --git a/eng/scripts/generate_reflected_calls.py b/eng/scripts/generate_reflected_calls.py index a1ced9f77..597eaf341 100644 --- a/eng/scripts/generate_reflected_calls.py +++ b/eng/scripts/generate_reflected_calls.py @@ -26,7 +26,7 @@ def get_func_type_names(i): return get_type_names(i - 1) + ['TRet'] def get_cast_args(i): - 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))] + 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))] def get_type_params(i): if i == 0: return '' @@ -84,7 +84,7 @@ def gen_fast_creation(cw): cw.enter_block('private static CallInstruction FastCreate%s(MethodInfo target, ParameterInfo[] pi)' % get_type_params(i)) cw.write('Type t = TryGetParameterOrReturnType(target, pi, %d);' % (i, )) - cw.enter_block('if (t == null)') + cw.enter_block('if (t is null)') typeArgs = ', '.join(get_type_names(i)) if i == 0: diff --git a/src/dlr b/src/dlr index 9037a76c5..828bdb47d 160000 --- a/src/dlr +++ b/src/dlr @@ -1 +1 @@ -Subproject commit 9037a76c57363b4a953e37135bbdb82ada277b1d +Subproject commit 828bdb47d610b07ffaf6be657b810a547992839c