Skip to content

Commit

Permalink
Fix for #484: module 'plistlib' has no attribute 'readPlist' (#485)
Browse files Browse the repository at this point in the history
* Fix for #484: module 'plistlib' has no attribute 'readPlist'

Pythonista 3 was recently upgraded to python3.10. This fix mirigates plist.py:8: DeprecationWarning: The readPlist function is deprecated, use load() instead pl=plistlib.readPlist(fileName)

* Typo fix

* isAlive(

* Fix whitespace

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
robco and cclauss authored May 4, 2023
1 parent 9f55ca4 commit 089d591
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion system/shcommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
if IN_PYTHONISTA:
import plistlib

_properties = plistlib.readPlist(os.path.join(os.path.dirname(sys.executable), 'Info.plist'))
with open(os.path.join(os.path.dirname(sys.executable), 'Info.plist'), 'rb') as fp:
_properties = plistlib.loads(fp.read())
PYTHONISTA_VERSION = _properties['CFBundleShortVersionString']
PYTHONISTA_VERSION_LONG = _properties['CFBundleVersion']

Expand Down
2 changes: 1 addition & 1 deletion system/shui/pythonista_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def render(self, no_wait=False):
self.render_thread.cancel()
self._render()
else: # delayed rendering
if self.render_thread is None or not self.render_thread.isAlive():
if self.render_thread is None or not self.render_thread.is_alive():
self.render_thread = sh_delay(self._render, self.RENDER_INTERVAL)
# Do nothing if there is already a delayed rendering thread waiting

Expand Down

0 comments on commit 089d591

Please sign in to comment.