| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -136,8 +136,7 @@ public static IntPtr tp_descr_get(IntPtr ds, IntPtr ob, IntPtr tp) | |||
| 136 | 136 | public static IntPtr tp_repr(IntPtr ob) | |
| 137 | 137 | { | |
| 138 | 138 | var self = (FieldObject)GetManagedObject(ob); | |
| 139 | - string s = $"<field '{self.info.Name}'>"; | ||
| 140 | - return Runtime.PyString_FromStringAndSize(s, s.Length); | ||
| 139 | + return Runtime.PyString_FromString($"<field '{self.info.Name}'>"); | ||
| 141 | 140 | } | |
| 142 | 141 | } | |
| 143 | 142 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -231,8 +231,8 @@ public static IntPtr tp_repr(IntPtr ob) | |||
| 231 | 231 | { | |
| 232 | 232 | var self = (MethodBinding)GetManagedObject(ob); | |
| 233 | 233 | string type = self.target == IntPtr.Zero ? "unbound" : "bound"; | |
| 234 | - string s = string.Format("<{0} method '{1}'>", type, self.m.name); | ||
| 235 | - return Runtime.PyString_FromStringAndSize(s, s.Length); | ||
| 234 | + string name = self.m.name; | ||
| 235 | + return Runtime.PyString_FromString($"<{type} method '{name}'>"); | ||
| 236 | 236 | } | |
| 237 | 237 | ||
| 238 | 238 | /// <summary> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,8 +187,7 @@ public static IntPtr tp_descr_get(IntPtr ds, IntPtr ob, IntPtr tp) | |||
| 187 | 187 | public static IntPtr tp_repr(IntPtr ob) | |
| 188 | 188 | { | |
| 189 | 189 | var self = (MethodObject)GetManagedObject(ob); | |
| 190 | - string s = string.Format("<method '{0}'>", self.name); | ||
| 191 | - return Runtime.PyString_FromStringAndSize(s, s.Length); | ||
| 190 | + return Runtime.PyString_FromString($"<method '{self.name}'>"); | ||
| 192 | 191 | } | |
| 193 | 192 | ||
| 194 | 193 | /// <summary> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,8 +33,7 @@ public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw) | |||
| 33 | 33 | public new static IntPtr tp_repr(IntPtr ob) | |
| 34 | 34 | { | |
| 35 | 35 | var self = (ModuleFunctionObject)GetManagedObject(ob); | |
| 36 | - string s = $"<CLRModuleFunction '{self.name}'>"; | ||
| 37 | - return Runtime.PyString_FromStringAndSize(s, s.Length); | ||
| 36 | + return Runtime.PyString_FromString($"<CLRModuleFunction '{self.name}'>"); | ||
| 38 | 37 | } | |
| 39 | 38 | } | |
| 40 | 39 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -158,8 +158,7 @@ public static IntPtr tp_descr_get(IntPtr ds, IntPtr ob, IntPtr tp) | |||
| 158 | 158 | public static IntPtr tp_repr(IntPtr ob) | |
| 159 | 159 | { | |
| 160 | 160 | var self = (PropertyObject)GetManagedObject(ob); | |
| 161 | - string s = $"<property '{self.info.Name}'>"; | ||
| 162 | - return Runtime.PyString_FromStringAndSize(s, s.Length); | ||
| 161 | + return Runtime.PyString_FromString($"<property '{self.info.Name}'>"); | ||
| 163 | 162 | } | |
| 164 | 163 | } | |
| 165 | 164 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ public PyAnsiString(PyObject o) | |||
| 44 | 44 | /// </remarks> | |
| 45 | 45 | public PyAnsiString(string s) | |
| 46 | 46 | { | |
| 47 | - obj = Runtime.PyString_FromStringAndSize(s, s.Length); | ||
| 47 | + obj = Runtime.PyString_FromString(s); | ||
| 48 | 48 | if (obj == IntPtr.Zero) | |
| 49 | 49 | { | |
| 50 | 50 | throw new PythonException(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments