瀏覽代碼

pbltool: modernize for Python3

Signed-off-by: Joshua Wise <joshua@accelerated.tech>
Joshua Wise 3 月之前
父節點
當前提交
8dbb8a6acf
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 3 3
      python_libs/pbl/pbl/__init__.py
  2. 1 1
      python_libs/pbl/pbl/commands/coredump.py

+ 3 - 3
python_libs/pbl/pbl/__init__.py

@@ -3,9 +3,9 @@ import logging
 import pebble_tool
 from libpebble2.communication.transports.pulse import PULSETransport
 from libpebble2.exceptions import PebbleError
-from commands import coredump
-from commands import install_lang
-from commands import test
+from .commands import coredump
+from .commands import install_lang
+from .commands import test
 
 # TODO: unopened logging ports cause super noisy logs, fix this in the
 # pulse package then remove this

+ 1 - 1
python_libs/pbl/pbl/commands/coredump.py

@@ -36,7 +36,7 @@ class CoredumpCommand(PebbleCommand):
         self.progress_bar.finish()
 
         filename = self._generate_filename() if args.filename is None else args.filename
-        with open(filename, "w") as core_file:
+        with open(filename, "wb") as core_file:
             core_file.write(core_data)
         print("Saved coredump to {}".format(filename))