forked from ajdawson/windspharm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pyspharm.python3.patch
44 lines (41 loc) · 1.57 KB
/
.pyspharm.python3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- setup.py 2014-02-07 19:49:39.050480448 +0000
+++ setup.py.fixed 2014-02-07 19:49:44.814480457 +0000
@@ -3,6 +3,7 @@
# use "config_fc --fcompiler=gnu95 install" to build and install with
# another fortran compiler (e.g. gfortran).
+import setuptools
from numpy.distutils.core import setup, Extension
import os, sys
@@ -27,13 +28,13 @@
the terms of the SPHEREPACK license at
http://www2.cisl.ucar.edu/resources/legacy/spherepack/license\n
""")
- download = raw_input('Do you want to download SPHEREPACK now? (yes or no)')
+ download = input('Do you want to download SPHEREPACK now? (yes or no)')
if download not in ['Y','y','yes','Yes','YES']:
sys.exit(0)
- import urllib, tarfile
+ import urllib.request, tarfile
tarfname = 'spherepack3.2.tar'
URL="https://www2.cisl.ucar.edu/sites/default/files/"+tarfname
- urllib.urlretrieve(URL,tarfname)
+ urllib.request.urlretrieve(URL,tarfname)
if not os.path.isfile(tarfname):
raise IOError('Sorry, download failed')
tarf = tarfile.open(tarfname)
@@ -44,7 +45,7 @@
mem = tarf.extractfile(f)
fout = open(ff,'w')
for line in mem.readlines():
- fout.write(line)
+ fout.write(line.decode('utf-8'))
fout.close()
tarf.close()
@@ -57,5 +58,6 @@
url = "http://code.google.com/p/pyspharm",
ext_modules = [ext],
packages = ['spharm'],
- package_dir = {'spharm':'Lib'}
+ package_dir = {'spharm':'Lib'},
+ use_2to3=True,
)