Skip to content

Instantly share code, notes, and snippets.

@jschementi
Created July 28, 2011 13:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jschementi/1111557 to your computer and use it in GitHub Desktop.
Patch to make IronPython build for .NET 2.0
diff --git a/Languages/IronPython/IronPython.Modules/_csv.cs b/Languages/IronPython/IronPython.Modules/_csv.cs
index 982a735..9eef957 100644
--- a/Languages/IronPython/IronPython.Modules/_csv.cs
+++ b/Languages/IronPython/IronPython.Modules/_csv.cs
@@ -739,7 +739,11 @@ in CSV format.")]
_state = State.StartRecord;
_fields.Clear();
_is_numeric_field = false;
+#if !CLR2
_field.Clear();
+#else
+ _field = new StringBuilder();
+#endif
}
#endregion
@@ -982,7 +986,11 @@ in CSV format.")]
else
_fields.Add(field);
+#if !CLR2
_field.Clear();
+#else
+ _field = new StringBuilder();
+#endif
}
}
diff --git a/Languages/IronPython/IronPython/Modules/_ast.cs b/Languages/IronPython/IronPython/Modules/_ast.cs
index f486239..935649d 100644
--- a/Languages/IronPython/IronPython/Modules/_ast.cs
+++ b/Languages/IronPython/IronPython/Modules/_ast.cs
@@ -301,7 +301,11 @@ namespace IronPython.Modules
if (expr.Value == null)
return new Name("None", Load.Instance);
- if (expr.Value is int || expr.Value is double || expr.Value is Int64 || expr.Value is BigInteger || expr.Value is Complex)
+ if (expr.Value is int || expr.Value is double || expr.Value is Int64 || expr.Value is BigInteger
+#if !CLR2
+ || expr.Value is Complex
+#endif
+ )
ast = new Num(expr.Value);
else if (expr.Value is string)
ast = new Str((string)expr.Value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment