Skip to content

Commit 7f6f432

Browse files
fridrichmizdebsk
authored andcommitted
Fix tests with python 3.4
1 parent ef9385a commit 7f6f432

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/test_rpmbuild.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
import subprocess
66
import shutil
7-
import glob
87

98
from textwrap import dedent
109

@@ -101,8 +100,9 @@ def __invoke_rpmbuild(self, args):
101100
os.remove('tmperr')
102101
# RPM 4.19 and 4.20 use different BUILD directory structure, thus we search the filesystem
103102
# to find the actual location of build subdir without reliance on particular structure
104-
self.buildpath = glob.glob('rpmbuild/BUILD/**/{name}-subdir'.format(name=self.__name),
105-
recursive=True)[0]
103+
self.buildpath = [os.path.join(dirpath, d)
104+
for dirpath, dirnames, files in os.walk('rpmbuild/BUILD')
105+
for d in dirnames if d.endswith('{name}-subdir'.format(name=self.__name))][0]
106106
return (out, err, ret)
107107

108108
def set_env(self, name, value):

0 commit comments

Comments
 (0)