FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ToByteString for byte arrays represented as python str · pythonnet/pythonnet@09f8eb2 · GitHub

Repository navigation

Commit 09f8eb2

Browse files
committed
ToByteString for byte arrays represented as python str
1 parent bdeb298 commit 09f8eb2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/runtime/pyobject.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,14 @@ public override string ToString() {
824824
}
825825

826826

827+
public string ToByteString() {
828+
IntPtr strval = Runtime.PyObject_Str(obj);
829+
string result = Runtime.GetManagedString(strval);
830+
Runtime.Decref(strval);
831+
return result;
832+
}
833+
834+
827835
/// <summary>
828836
/// Equals Method
829837
/// </summary>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL