eric6/CondaInterface/Conda.py

changeset 8243
cc717c2ae956
parent 8222
5994b80b8760
child 8257
28146736bbfc
equal deleted inserted replaced
8242:aa713ac50c0d 8243:cc717c2ae956
7 Package implementing the conda GUI logic. 7 Package implementing the conda GUI logic.
8 """ 8 """
9 9
10 import json 10 import json
11 import os 11 import os
12 import contextlib
12 13
13 from PyQt5.QtCore import pyqtSignal, QObject, QProcess, QCoreApplication 14 from PyQt5.QtCore import pyqtSignal, QObject, QProcess, QCoreApplication
14 from PyQt5.QtWidgets import QDialog 15 from PyQt5.QtWidgets import QDialog
15 16
16 from E5Gui import E5MessageBox 17 from E5Gui import E5MessageBox
587 proc.start(exe, args) 588 proc.start(exe, args)
588 if proc.waitForStarted(15000) and proc.waitForFinished(30000): 589 if proc.waitForStarted(15000) and proc.waitForFinished(30000):
589 output = str(proc.readAllStandardOutput(), 590 output = str(proc.readAllStandardOutput(),
590 Preferences.getSystem("IOEncoding"), 591 Preferences.getSystem("IOEncoding"),
591 'replace').strip() 592 'replace').strip()
592 try: 593 with contextlib.suppress(Exception):
593 packages = json.loads(output) 594 packages = json.loads(output)
594 ok = "error" not in packages 595 ok = "error" not in packages
595 except Exception: # secok
596 # return values for errors is already set
597 pass
598 596
599 return ok, packages 597 return ok, packages
600 598
601 ####################################################################### 599 #######################################################################
602 ## special methods below 600 ## special methods below

eric ide

mercurial