Skip to content

Commit

Permalink
Use the basename of the wheel filename
Browse files Browse the repository at this point in the history
Using the basename allows us to avoid problems with bizarrely non-standard
usage.

Closes pypa#145
  • Loading branch information
sigmavirus24 committed Oct 26, 2015
1 parent 057bd71 commit e95247a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion twine/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ class Wheel(Distribution):

def __init__(self, filename, metadata_version=None):
self.filename = filename
self.basefilename = os.path.basename(self.filename)
self.metadata_version = metadata_version
self.extractMetadata()

@property
def py_version(self):
wheel_info = wheel_file_re.match(self.filename)
wheel_info = wheel_file_re.match(self.basefilename)
return wheel_info.group("pyver")

def read(self):
Expand Down

0 comments on commit e95247a

Please sign in to comment.