| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2726,22 +2726,10 @@ PyDevice_dealloc (PyDevice * self) | |||
| 2726 | 2726 | static PyObject * | |
| 2727 | 2727 | PyDevice_repr (PyDevice * self) | |
| 2728 | 2728 | { | |
| 2729 | - PyObject * id_bytes, * name_bytes, * type_bytes, * result; | ||
| 2730 | - | ||
| 2731 | - id_bytes = PyUnicode_AsUTF8String (self->id); | ||
| 2732 | - name_bytes = PyUnicode_AsUTF8String (self->name); | ||
| 2733 | - type_bytes = PyUnicode_AsUTF8String (self->type); | ||
| 2734 | - | ||
| 2735 | - result = PyRepr_FromFormat ("Device(id=\"%s\", name=\"%s\", type='%s')", | ||
| 2736 | - PyBytes_AsString (id_bytes), | ||
| 2737 | - PyBytes_AsString (name_bytes), | ||
| 2738 | - PyBytes_AsString (type_bytes)); | ||
| 2739 | - | ||
| 2740 | - Py_XDECREF (type_bytes); | ||
| 2741 | - Py_XDECREF (name_bytes); | ||
| 2742 | - Py_XDECREF (id_bytes); | ||
| 2743 | - | ||
| 2744 | - return result; | ||
| 2729 | + return PyRepr_FromFormat ("Device(id=%R, name=%R, type=%R)", | ||
| 2730 | + self->id, | ||
| 2731 | + self->name, | ||
| 2732 | + self->type); | ||
| 2745 | 2733 | } | |
| 2746 | 2734 | ||
| 2747 | 2735 | static PyObject * | |
@@ -3270,28 +3258,22 @@ PyApplication_dealloc (PyApplication * self) | |||
| 3270 | 3258 | static PyObject * | |
| 3271 | 3259 | PyApplication_repr (PyApplication * self) | |
| 3272 | 3260 | { | |
| 3273 | - PyObject * identifier_bytes, * name_bytes, * result; | ||
| 3274 | - | ||
| 3275 | - identifier_bytes = PyUnicode_AsUTF8String (self->identifier); | ||
| 3276 | - name_bytes = PyUnicode_AsUTF8String (self->name); | ||
| 3261 | + PyObject * result; | ||
| 3277 | 3262 | ||
| 3278 | 3263 | if (self->pid != 0) | |
| 3279 | 3264 | { | |
| 3280 | - result = PyRepr_FromFormat ("Application(identifier=\"%s\", name=\"%s\", pid=%u)", | ||
| 3281 | - PyBytes_AsString (identifier_bytes), | ||
| 3282 | - PyBytes_AsString (name_bytes), | ||
| 3265 | + result = PyRepr_FromFormat ("Application(identifier=%R, name=%R, pid=%u)", | ||
| 3266 | + self->identifier, | ||
| 3267 | + self->name, | ||
| 3283 | 3268 | self->pid); | |
| 3284 | 3269 | } | |
| 3285 | 3270 | else | |
| 3286 | 3271 | { | |
| 3287 | - result = PyRepr_FromFormat ("Application(identifier=\"%s\", name=\"%s\")", | ||
| 3288 | - PyBytes_AsString (identifier_bytes), | ||
| 3289 | - PyBytes_AsString (name_bytes)); | ||
| 3272 | + result = PyRepr_FromFormat ("Application(identifier=%R, name=%R)", | ||
| 3273 | + self->identifier, | ||
| 3274 | + self->name); | ||
| 3290 | 3275 | } | |
| 3291 | 3276 | ||
| 3292 | - Py_XDECREF (name_bytes); | ||
| 3293 | - Py_XDECREF (identifier_bytes); | ||
| 3294 | - | ||
| 3295 | 3277 | return result; | |
| 3296 | 3278 | } | |
| 3297 | 3279 | ||
@@ -3344,17 +3326,9 @@ PyProcess_dealloc (PyProcess * self) | |||
| 3344 | 3326 | static PyObject * | |
| 3345 | 3327 | PyProcess_repr (PyProcess * self) | |
| 3346 | 3328 | { | |
| 3347 | - PyObject * name_bytes, * result; | ||
| 3348 | - | ||
| 3349 | - name_bytes = PyUnicode_AsUTF8String (self->name); | ||
| 3350 | - | ||
| 3351 | - result = PyRepr_FromFormat ("Process(pid=%u, name=\"%s\")", | ||
| 3329 | + return PyRepr_FromFormat ("Process(pid=%u, name=%R)", | ||
| 3352 | 3330 | self->pid, | |
| 3353 | - PyBytes_AsString (name_bytes)); | ||
| 3354 | - | ||
| 3355 | - Py_XDECREF (name_bytes); | ||
| 3356 | - | ||
| 3357 | - return result; | ||
| 3331 | + self->name); | ||
| 3358 | 3332 | } | |
| 3359 | 3333 | ||
| 3360 | 3334 | static PyObject * | |
@@ -3410,15 +3384,9 @@ PySpawn_repr (PySpawn * self) | |||
| 3410 | 3384 | ||
| 3411 | 3385 | if (self->identifier != Py_None) | |
| 3412 | 3386 | { | |
| 3413 | - PyObject * identifier_bytes; | ||
| 3414 | - | ||
| 3415 | - identifier_bytes = PyUnicode_AsUTF8String (self->identifier); | ||
| 3416 | - | ||
| 3417 | - result = PyRepr_FromFormat ("Spawn(pid=%u, identifier=\"%s\")", | ||
| 3387 | + result = PyRepr_FromFormat ("Spawn(pid=%u, identifier=%R)", | ||
| 3418 | 3388 | self->pid, | |
| 3419 | - PyBytes_AsString (identifier_bytes)); | ||
| 3420 | - | ||
| 3421 | - Py_XDECREF (identifier_bytes); | ||
| 3389 | + self->identifier); | ||
| 3422 | 3390 | } | |
| 3423 | 3391 | else | |
| 3424 | 3392 | { | |
@@ -3660,7 +3628,11 @@ PyIcon_dealloc (PyIcon * self) | |||
| 3660 | 3628 | static PyObject * | |
| 3661 | 3629 | PyIcon_repr (PyIcon * self) | |
| 3662 | 3630 | { | |
| 3663 | - return PyRepr_FromFormat ("Icon(width=%d, height=%d, rowstride=%d, pixels=<%zd bytes>)", self->width, self->height, self->rowstride, PyBytes_Size (self->pixels)); | ||
| 3631 | + return PyRepr_FromFormat ("Icon(width=%d, height=%d, rowstride=%d, pixels=<%zd bytes>)", | ||
| 3632 | + self->width, | ||
| 3633 | + self->height, | ||
| 3634 | + self->rowstride, | ||
| 3635 | + PyBytes_Size (self->pixels)); | ||
| 3664 | 3636 | } | |
| 3665 | 3637 | ||
| 3666 | 3638 | ||
@@ -3735,7 +3707,8 @@ PySession_init_from_handle (PySession * self, FridaSession * handle) | |||
| 3735 | 3707 | static PyObject * | |
| 3736 | 3708 | PySession_repr (PySession * self) | |
| 3737 | 3709 | { | |
| 3738 | - return PyRepr_FromFormat ("Session(pid=%u)", self->pid); | ||
| 3710 | + return PyRepr_FromFormat ("Session(pid=%u)", | ||
| 3711 | + self->pid); | ||
| 3739 | 3712 | } | |
| 3740 | 3713 | ||
| 3741 | 3714 | static PyObject * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments