Skip to content

Commit 20e1d37

Browse files
committed
Merge pull request #115 from tonyroberts/develop-clean
Fix for 3dsMax Python
2 parents 0333faa + 2dc2622 commit 20e1d37

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/runtime/assemblymanager.cs

+13-7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Collections;
1313
using System.Collections.Specialized;
1414
using System.Collections.Generic;
15+
using System.Diagnostics;
1516
using System.Reflection;
1617
using System.Reflection.Emit;
1718

@@ -57,10 +58,17 @@ internal static void Initialize() {
5758
domain.AssemblyResolve += rhandler;
5859

5960
Assembly[] items = domain.GetAssemblies();
60-
for (int i = 0; i < items.Length; i++) {
61-
Assembly a = items[i];
62-
assemblies.Add(a);
63-
ScanAssembly(a);
61+
foreach (var a in items)
62+
{
63+
try
64+
{
65+
ScanAssembly(a);
66+
assemblies.Add(a);
67+
}
68+
catch (Exception ex)
69+
{
70+
Debug.WriteLine(string.Format("Error scanning assembly {0}. {1}", a, ex));
71+
}
6472
}
6573
}
6674

@@ -316,9 +324,7 @@ internal static void ScanAssembly(Assembly assembly) {
316324
for (int n = 0; n < names.Length; n++) {
317325
s = (n == 0) ? names[0] : s + "." + names[n];
318326
if (!namespaces.ContainsKey(s)) {
319-
namespaces.Add(s,
320-
new Dictionary<Assembly, string>()
321-
);
327+
namespaces.Add(s, new Dictionary<Assembly, string>());
322328
}
323329
}
324330
}

0 commit comments

Comments
 (0)