yhttp-dev 3.4.0__tar.gz → 3.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yhttp-dev
3
- Version: 3.4.0
3
+ Version: 3.4.2
4
4
  Summary: yhttp development utilities
5
5
  Home-page: https://github.com/yhttp/yhttp-dev
6
6
  Author: pylover
@@ -0,0 +1 @@
1
+ __version__ = '3.4.2'
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import sys
2
3
  import stat
3
4
  import shutil
4
5
  import socket
@@ -20,12 +21,8 @@ def bddcli_bootstrapper_patch(tempdir):
20
21
  @contextlib.contextmanager
21
22
  def patch(pycode):
22
23
  tmp = tempfile.mkdtemp()
23
-
24
- venvdir = os.environ.get('VIRTUAL_ENV')
25
- if venvdir is None:
26
- raise ValueError('Tests must be run inside a virtual env')
27
-
28
- bsfile = os.path.join(venvdir, 'bin', 'bddcli-bootstrapper')
24
+ bindir = os.path.dirname(sys.executable)
25
+ bsfile = os.path.join(bindir, 'bddcli-bootstrapper')
29
26
  assert os.path.exists(bsfile)
30
27
  newname = os.path.join(tempdir, 'backup')
31
28
  os.rename(bsfile, os.path.join(tempdir, 'backup'))
@@ -41,10 +38,11 @@ def bddcli_bootstrapper_patch(tempdir):
41
38
  mode |= stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
42
39
  os.fchmod(outfile.fileno(), stat.S_IMODE(mode))
43
40
 
44
- yield
45
-
46
- os.rename(newname, bsfile)
47
- shutil.rmtree(tmp)
41
+ try:
42
+ yield
43
+ finally:
44
+ os.rename(newname, bsfile)
45
+ shutil.rmtree(tmp)
48
46
 
49
47
  return patch
50
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yhttp-dev
3
- Version: 3.4.0
3
+ Version: 3.4.2
4
4
  Summary: yhttp development utilities
5
5
  Home-page: https://github.com/yhttp/yhttp-dev
6
6
  Author: pylover
@@ -1 +0,0 @@
1
- __version__ = '3.4.0'
File without changes
File without changes
File without changes
File without changes