Fix flake8 issues found in cli

This commit is contained in:
Micah Lee 2021-04-29 17:13:05 -07:00
parent 343e1be3d0
commit 0a6056e5e6
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
14 changed files with 146 additions and 128 deletions

View file

@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import os, shutil
import os
import shutil
from .common import AutoStopTimer
@ -57,7 +58,7 @@ class OnionShare(object):
"""
try:
self.port = self.common.get_available_port(17600, 17650)
except:
except Exception:
raise OSError("Cannot find an available OnionShare port")
def start_onion_service(self, mode, mode_settings, await_publication=True):
@ -102,7 +103,7 @@ class OnionShare(object):
os.remove(filename)
elif os.path.isdir(filename):
shutil.rmtree(filename)
except:
except Exception:
# Don't crash if file is still in use
pass
self.cleanup_filenames = []