8000 Update RuntimeData.cs · pythonnet/pythonnet@907011e · GitHub
[go: up one dir, main page]

Skip to content

Commit 907011e

Browse files
authored
Update RuntimeData.cs
1 parent eaca7f1 commit 907011e

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/runtime/StateSerialization/RuntimeData.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,16 @@ public static class RuntimeData
1818

1919
public readonly static Func<IFormatter> DefaultFormatterFactory = () =>
2020
{
21-
var fw = RuntimeInformation.FrameworkDescription ?? "undefined";
22-
if (fw.StartsWith(".NET Framework") || fw.StartsWith("Mono"))
21+
try
2322
{
24-
try
23+
var fw = RuntimeInformation.FrameworkDescription;
24+
if (fw.StartsWith(".NET Framework") || fw.StartsWith("Mono"))
2525
{
2626
return new BinaryFormatter();
2727
}
28-
catch
29-
{
30-
return new NoopFormatter();
31-
}
32-
}
33-
else
34-
{
35-
return new NoopFormatter();
3628
}
29+
catch {}
30+
return new NoopFormatter();
3731
};
3832

3933
private static Func<IFormatter> _formatterFactory { get; set; } = DefaultFormatterFactory;

0 commit comments

Comments
 (0)
0