Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Commit

Permalink
Remove removal of DISPLAY environment variable
Browse files Browse the repository at this point in the history
The issue has to do with the two lines:

` if "DISPLAY" in os.environ:
    del os.environ["DISPLAY"]`

This seems to remove the DISPLAY environment variable unnecessarily, as on line 50 of xvfbwrapper.py, self.orig_display is set to the value of DISPLAY. self.orig_display is checked on line 83, which is where the error occurs. Because of xvfb.py removing the environment variable and self.orig_display being set to the original value, on line 84 when it tries to remove DISPLAY, it has already been removed by xvfb.py, so it throws a KeyError.
  • Loading branch information
willzhang05 committed Feb 19, 2017
1 parent caa62c3 commit 05adb44
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions dryscrape/xvfb.py
Expand Up @@ -3,15 +3,15 @@

_xvfb = None


def start_xvfb():
from xvfbwrapper import Xvfb
global _xvfb
if "DISPLAY" in os.environ:
del os.environ["DISPLAY"]
_xvfb = Xvfb()
_xvfb.start()
atexit.register(_xvfb.stop)
from xvfbwrapper import Xvfb
global _xvfb
_xvfb = Xvfb()
_xvfb.start()
atexit.register(_xvfb.stop)


def stop_xvfb():
global _xvfb
_xvfb.stop()
global _xvfb
_xvfb.stop()

0 comments on commit 05adb44

Please sign in to comment.