mirror of
https://github.com/esphome/esphome.git
synced 2025-09-06 05:12:21 +01:00
Drop Python 2 Support (#793)
* Remove Python 2 support * Remove u-strings * Remove docker symlinks * Remove from travis * Update requirements * Upgrade flake8/pylint * Fixes * Manual * Run pyupgrade * Lint * Remove base_int * Fix * Update platformio_api.py * Update component.cpp
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -7,7 +5,6 @@ import re
|
||||
import subprocess
|
||||
|
||||
from esphome.core import CORE
|
||||
from esphome.py_compat import decode_text
|
||||
from esphome.util import run_external_command, run_external_process
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -61,6 +58,7 @@ FILTER_PLATFORMIO_LINES = [
|
||||
r'Installing dependencies',
|
||||
r'.* @ .* is already installed',
|
||||
r'Building in .* mode',
|
||||
r'Advanced Memory Usage is available via .*',
|
||||
]
|
||||
|
||||
|
||||
@@ -100,8 +98,7 @@ def run_upload(config, verbose, port):
|
||||
|
||||
def run_idedata(config):
|
||||
args = ['-t', 'idedata']
|
||||
stdout = run_platformio_cli_run(config, False, *args, capture_stdout=True)
|
||||
stdout = decode_text(stdout)
|
||||
stdout = run_platformio_cli_run(config, False, *args, capture_stdout=True).decode()
|
||||
match = re.search(r'{\s*".*}', stdout)
|
||||
if match is None:
|
||||
_LOGGER.debug("Could not match IDEData for %s", stdout)
|
||||
@@ -172,7 +169,7 @@ def _decode_pc(config, addr):
|
||||
return
|
||||
command = [idedata.addr2line_path, '-pfiaC', '-e', idedata.firmware_elf_path, addr]
|
||||
try:
|
||||
translation = decode_text(subprocess.check_output(command)).strip()
|
||||
translation = subprocess.check_output(command).decode().strip()
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_LOGGER.debug("Caught exception for command %s", command, exc_info=1)
|
||||
return
|
||||
@@ -246,7 +243,7 @@ def process_stacktrace(config, line, backtrace_state):
|
||||
return backtrace_state
|
||||
|
||||
|
||||
class IDEData(object):
|
||||
class IDEData:
|
||||
def __init__(self, raw):
|
||||
if not isinstance(raw, dict):
|
||||
self.raw = {}
|
||||
|
Reference in New Issue
Block a user