Skip to content

Commit

Permalink
Merge branch '2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Feb 20, 2017
2 parents 72be58b + 12004eb commit b83580d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions paramiko/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ def get_adaptive_int(self):
def get_int(self):
"""
Fetch an int from the stream.
@return: a 32-bit unsigned integer.
@rtype: int
"""
return struct.unpack('>I', self.get_bytes(4))[0]

Expand Down Expand Up @@ -176,24 +173,15 @@ def get_string(self):

def get_text(self):
"""
Fetch a string from the stream. This could be a byte string and may
contain unprintable characters. (It's not unheard of for a string to
contain another byte-stream Message.)
@return: a string.
@rtype: string
Fetch a Unicode string from the stream.
"""
return u(self.get_bytes(self.get_int()))
#return self.get_bytes(self.get_size())
return u(self.get_string())

def get_binary(self):
"""
Fetch a string from the stream. This could be a byte string and may
contain unprintable characters. (It's not unheard of for a string to
contain another byte-stream Message.)
@return: a string.
@rtype: string
"""
return self.get_bytes(self.get_int())

Expand Down

0 comments on commit b83580d

Please sign in to comment.