From: Mike Frysinger Date: Sat, 22 Aug 2026 16:36:38 +0000 (+0700) Subject: le-renew: drop Python 2 logic X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ad19333661738d21a457f2f82b557bb15c505bf8;p=home.git le-renew: drop Python 2 logic --- diff --git a/.bin/le-renew b/.bin/le-renew index 58e687b..c274e68 100755 --- a/.bin/le-renew +++ b/.bin/le-renew @@ -1,5 +1,4 @@ -#!/usr/bin/python -#-*- coding:utf-8 -*- +#!/usr/bin/env python3 # pylint: disable=invalid-name """Renew Let's Encrypt certs! @@ -10,20 +9,12 @@ $ certbot certonly --webroot \\ --webroot-path /var/www/rss/ -d rss.wh0rd.org """ -from __future__ import print_function - import argparse -try: - import configparser -except ImportError: - import ConfigParser as configparser +import configparser import cryptography.hazmat.backends from cryptography import x509 -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO import datetime +import io import logging import logging.handlers import os @@ -90,7 +81,7 @@ def load_conf(domain): path = os.path.join(LE_BASE, 'renewal', domain + '.conf') # The config file format is almost enough for the configparser. # We need to insert a section header for the first few items. - fp = StringIO() + fp = io.StringIO() fp.write('[globals]\n') fp.write(open(path).read()) fp.seek(0)