<p>This should <span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #808.">fix</span> <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="395915551" data-permission-text="Issue title is private" data-url="https://github.com/geany/geany-plugins/issues/808" data-hovercard-type="issue" data-hovercard-url="/geany/geany-plugins/issues/808/hovercard" href="https://github.com/geany/geany-plugins/issues/808">#808</a>.</p>
<p>The approach here is to try and have the Python callback return value be used as the C one is. I'm not totally sure how compatible that is, but IIUC if a Python function doesn't explicitly return it returns None, which should (I guess) fail the <code>PyObject_IsTrue()</code> check.</p>
<p>I did <em>not</em> test this <em>at all</em>: I didn't even try to build it (thanks to a crappy Internet connection tonight, I didn't wait long enough to fetch the dependencies).  This PR should be reviewed as what it is: an attempt at a fix by a guy that doesn't know neither the API nor the plugin :)</p>
<p>However, this should also fix a leak as the return value should likely be <code>DECREF</code>'d in any case.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany-plugins/pull/809'>https://github.com/geany/geany-plugins/pull/809</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>geanypy: Use Python callback return value for keybindings return value</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany-plugins/pull/809/files#diff-0">geanypy/src/geanypy-keybindings.c</a>
    (8)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany-plugins/pull/809.patch'>https://github.com/geany/geany-plugins/pull/809.patch</a></li>
  <li><a href='https://github.com/geany/geany-plugins/pull/809.diff'>https://github.com/geany/geany-plugins/pull/809.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/pull/809">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ90KptJfod9sTOkoPQjOUxZ0ELSiks5u_98dgaJpZM4ZuLmn">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ-vSRcFeIdW-Ni8fAqbqox5hP9Jsks5u_98dgaJpZM4ZuLmn.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany-plugins","title":"geany/geany-plugins","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany-plugins"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"geanypy: Use Python callback return value for keybindings return value (#809)"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany-plugins/pull/809"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/809",
"url": "https://github.com/geany/geany-plugins/pull/809",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>