Commit f441bb7d authored by ChrisPerkins's avatar ChrisPerkins

Fix bug 208262 for files with odd characters in them

parent 57aed717
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Cython Top Level # Cython Top Level
# #
import os, sys import os, sys, re
if sys.version_info[:2] < (2, 2): if sys.version_info[:2] < (2, 2):
print >>sys.stderr, "Sorry, Cython requires Python 2.2 or later" print >>sys.stderr, "Sorry, Cython requires Python 2.2 or later"
sys.exit(1) sys.exit(1)
...@@ -166,7 +166,9 @@ class Context: ...@@ -166,7 +166,9 @@ class Context:
cwd = os.getcwd() cwd = os.getcwd()
if full_module_name is None: if full_module_name is None:
full_module_name, _ = os.path.splitext(source.replace('/', '.')) full_module_name, _ = os.path.splitext(source)
full_module_name = re.sub(r'[\\/]', '.', full_module_name)
full_module_name = re.sub(r'[^\w.]', '_', full_module_name)
source = os.path.join(cwd, source) source = os.path.join(cwd, source)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment