Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8c304de

Browse filesBrowse files
committed
refactor common code outside loop
1 parent b3967e7 commit 8c304de
Copy full SHA for 8c304de

File tree

Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,14 @@ def do_custom_build(self):
10471047
pass
10481048

10491049
if not os.path.isfile(tarball_path):
1050+
1051+
if sys.version_info[0] == 2:
1052+
from urllib import urlretrieve
1053+
else:
1054+
from urllib.request import urlretrieve
1055+
if not os.path.exists('build'):
1056+
os.makedirs('build')
1057+
10501058
sourceforge_url = (
10511059
'http://downloads.sourceforge.net/project/freetype'
10521060
'/freetype2/{0}/'.format(LOCAL_FREETYPE_VERSION)
@@ -1059,13 +1067,6 @@ def do_custom_build(self):
10591067
tarball_url = url_fmt.format(tarball)
10601068

10611069
print("Downloading {0}".format(tarball_url))
1062-
if sys.version_info[0] == 2:
1063-
from urllib import urlretrieve
1064-
else:
1065-
from urllib.request import urlretrieve
1066-
1067-
if not os.path.exists('build'):
1068-
os.makedirs('build')
10691070
try:
10701071
urlretrieve(tarball_url, tarball_path)
10711072
except:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.