Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Attempt to get things working on python3.2

 - Ran 2to3 on get_dosctring.py
 - Need to open the pickle file in binary mode
 - The import of slalib in pyslalib has to be
   explicitly via a relative path.
  • Loading branch information...
commit d535c887fe7aff0f308f6b961566886ebfffacca 1 parent 613f3a6
Tim Jenness timj authored
Showing with 6 additions and 6 deletions.
  1. +4 −4 get_docstring.py
  2. +1 −1  lib/__init__.py
  3. +1 −1  setup.py
8 get_docstring.py
View
@@ -23,7 +23,7 @@ def get_docstring():
file_list = glob.glob('*.[fF]')
- print "%d files found." % len(file_list)
+ print("%d files found." % len(file_list))
for i,file_name in enumerate(file_list):
f = open(file_name, "r")
@@ -33,9 +33,9 @@ def get_docstring():
name_line = f.readline()
matches = name_regex.search(name_line)
if len(matches.groups()) != 1: # there should be only one match
- raise ValueError, "More than one match for function name."
+ raise ValueError("More than one match for function name.")
name = matches.group()
- print "Reading %10s in %s." % (name, file_name)
+ print("Reading %10s in %s." % (name, file_name))
doc = []
inside = 0
@@ -55,7 +55,7 @@ def get_docstring():
f.close()
- print "%d functions read from %d files." % (len(doc_dict), len(file_list))
+ print("%d functions read from %d files." % (len(doc_dict), len(file_list)))
return doc_dict
if __name__ == "__main__":
2  lib/__init__.py
View
@@ -18,7 +18,7 @@
"""
import pickle
import os
-import slalib
+from .slalib import slalib
# A dictionary with functions as keys and comments in SLALIB
# Fortran files as value strings. Use
2  setup.py
View
@@ -6,7 +6,7 @@
# Generate documentation dictionary and save it in "lib/"
docstring = get_docstring.get_docstring()
-f = open("lib/docstring_pickle.pkl", "w")
+f = open("lib/docstring_pickle.pkl", "wb")
pickle.dump(docstring, f)
f.close()
Please sign in to comment.
Something went wrong with that request. Please try again.