Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

syncing to head of tfs

  • Loading branch information...
commit 1b292db0fb96abaab722d84b30fff10a0b5b9626 1 parent 7d93913
@jredville jredville authored
View
0  1
No changes.
View
3  Merlin/Main/Debugging/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.csproj
@@ -105,7 +105,6 @@
<NoWarn>1591</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
- <CodeAnalysisRuleAssemblies>%ProgramFiles%\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleAssemblies>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
@@ -183,4 +182,4 @@
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" Condition=" '$(SilverlightTreeBuild)' != 'true' " />
<Import Project="..\..\silverlight.build.targets" Condition=" '$(SilverlightTreeBuild)' == 'true' " />
<Import Condition=" '$(Golden)' == 'True'" Project="..\..\External\Build\Microsoft.VersionNumber.targets" />
-</Project>
+</Project>
View
4 Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonProtocol.Operations.cs
@@ -483,8 +483,8 @@ static partial class PythonProtocol {
self.Restrictions
);
}
- } else if (self.Value is IEnumerable ||
- typeof(IEnumerable).IsAssignableFrom(self.GetLimitType())) {
+ } else if ((self.Value is IEnumerable ||
+ typeof(IEnumerable).IsAssignableFrom(self.GetLimitType())) && !(self.Value is PythonGenerator)) {
self = self.Restrict(self.GetLimitType());
return new DynamicMetaObject(
View
11 Merlin/Main/Languages/IronPython/IronPython/Runtime/Generator.cs
@@ -30,7 +30,7 @@
namespace IronPython.Runtime {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix"), PythonType("generator")]
[DontMapIDisposableToContextManager, DontMapIEnumerableToContains]
- public sealed class PythonGenerator : IEnumerator, IEnumerator<object>, ICodeFormattable {
+ public sealed class PythonGenerator : IEnumerator, IEnumerator<object>, ICodeFormattable, IEnumerable {
private readonly Func<MutableTuple, object>/*!*/ _next; // The delegate which contains the user code to perform the iteration.
private readonly PythonFunction _function; // the function which created the generator
private readonly MutableTuple _data; // the closure data we need to pass into each iteration. Item000 is the index, Item001 is the current value
@@ -564,5 +564,14 @@ class GeneratorFinalizer {
}
}
}
+
+ #region IEnumerable Members
+
+ IEnumerator IEnumerable.GetEnumerator() {
+ // only present for better C# interop
+ return this;
+ }
+
+ #endregion
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.