10000 use NonCopyableAnalyzer 0.7.0-m05 · pythonnet/pythonnet@a86994f · GitHub
[go: up one dir, main page]

Skip to content

Commit a86994f

Browse files
committed
use NonCopyableAnalyzer 0.7.0-m05
remote analyzer workaround
1 parent d6edace commit a86994f

File tree

9 files changed

+15
-20
lines changed

9 files changed

+15
-20
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1515
</PackageReference>
16-
<PackageReference Include="Lost.NonCopyableAnalyzer" Version="0.7.0-m04">
16+
<PackageReference Include="Lost.NonCopyableAnalyzer" Version="0.7.0-m05">
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>

src/runtime/NewReference.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,5 @@ public static BorrowedReference Borrow(this in NewReference reference)
156156
[DebuggerHidden]
157157
public static BorrowedReference BorrowOrThrow(this in NewReference reference)
158158
=> reference.IsNull() ? throw PythonException.ThrowLastAsClrException() : reference.BorrowNullable();
159-
160-
[Obsolete]
161-
[DebuggerHidden]
162-
public static NewReference AnalyzerWorkaround(this in NewReference reference)
163-
=> NewReference.DangerousFromPointer(reference.DangerousGetAddress());
164159
}
165160
}

src/runtime/classderived.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ internal static NewReference ToPython(IPythonDerivedType obj)
133133
Runtime.PyObject_GC_Track(self);
134134
}
135135

136-
return result.AnalyzerWorkaround();
136+
return result;
137137
}
138138

139139
/// <summary>

src/runtime/clrobject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static NewReference Create(object ob, BorrowedReference tp)
3030
// slot if wrapping a CLR exception
3131
if (ob is Exception e) Exceptions.SetArgsAndCause(py.Borrow(), e);
3232

33-
return py.AnalyzerWorkaround();
33+
return py;
3434
}
3535

3636
CLRObject(object inst)

src/runtime/extensiontype.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public virtual NewReference Alloc()
3737
#endif
3838
SetupGc(py.Borrow(), tp);
3939

40-
return py.AnalyzerWorkaround();
40+
return py;
4141
}
4242

4343
public PyObject AllocObject() => new PyObject(Alloc().Steal());

src/runtime/indexer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ internal NewReference GetDefaultArgs(BorrowedReference args)
113113
using var arg = Converter.ToPython(pi[i + pynargs].DefaultValue, pi[i + pynargs].ParameterType);
114114
Runtime.PyTuple_SetItem(defaultArgs.Borrow(), i, arg.Steal());
115115
}
116-
return defaultArgs.AnalyzerWorkaround();
116+
return defaultArgs;
117117
}
118118
}
119119
}

src/runtime/metatype.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static NewReference tp_new(BorrowedReference tp, BorrowedReference args,
172172

173173
Runtime.PyType_Modified(type.Borrow());
174174

175-
return type.AnalyzerWorkaround();
175+
return type;
176176
}
177177

178178

src/runtime/moduleobject.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public override NewReference Alloc()
7878

7979
InitializeModuleMembers();
8080

81-
return py.AnalyzerWorkaround();
81+
return py;
8282
}
8383

8484

@@ -118,8 +118,8 @@ public NewReference GetAttribute(string name, bool guess)
118118
if (AssemblyManager.IsValidNamespace(qname))
119119
{
120120
var m = ModuleObject.Create(qname);
121-
StoreAttribute(name, m.Borrow());
122-
return m.AnalyzerWorkaround();
121+
this.StoreAttribute(name, m.Borrow());
122+
return m;
123123
}
124124

125125
// Look for a type in the current namespace. Note that this
@@ -142,14 +142,14 @@ public NewReference GetAttribute(string name, bool guess)
142142
// enough to complicate the implementation for now.
143143
if (guess)
144144
{
145-
string gname = GenericUtil.GenericNameForBaseName(_namespace, name);
145+
string gname = GenericUtil.GenericNameForBaseName(this._namespace, name);
146146
if (gname != null)
147147
{
148-
var o = GetAttribute(gname, false);
148+
var o = this.GetAttribute(gname, false);
149149
if (!o.IsNull())
150150
{
151-
StoreAttribute(name, o.Borrow());
152-
return o.AnalyzerWorkaround();
151+
this.StoreAttribute(name, o.Borrow());
152+
return o;
153153
}
154154
}
155155
}
@@ -306,7 +306,7 @@ public static NewReference tp_getattro(BorrowedReference ob, BorrowedReference k
306306
return default;
307307
}
308308

309-
return attr.AnalyzerWorkaround();
309+
return attr;
310310
}
311311

312312
/// <summary>

src/runtime/runtime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ internal static NewReference ExtendTuple(BorrowedReference t, params PyObject[]
618618
PyTuple_SetItem(items.Borrow(), size + n, args[n]);
619619
}
620620

621-
return items.AnalyzerWorkaround();
621+
return items;
622622
}
623623

624624
internal static Type[]? PythonArgsToTypeArray(BorrowedReference arg)

0 commit comments

Comments
 (0)
0